Uploaded image for project: 'CloverDX'
  1. CloverDX
  2. CLO-18040

List and map initializers

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: rel-5-6-0
    • Component/s: None
    • Security Level: Users (General product issues)
    • Story Points:
      5
    • QA Testing:
      UNDECIDED
    • Epic Link:
    • Sprint:
      Green Sprint 104, Green Sprint 105, Green Sprint 106

      Description

      • For initializing empty lists and maps, introduce two new literals:
        • [ ] - empty list
        • { } - empty map
      • For initializing non-empty maps, introduce new MAP initializer with following syntax:
        { <key> -> <value> , .. -> .., …}
        

        The key & value can be any valid statement (i.e. literals, expressions, calls to functions, etc.)
        Examples:

        map[string,string] mymap1 = { “A” -> “ABC” , “B”->”BCD”, “C”->”CDE”};
        map[string,string] mymap2 = { substring(“ABCDEF”,0,1) ->  substring(“ABCDEF”,0,3) ,  substring(“ABCDEF”,1,1) ->  substring(“ABCDEF”,1,3),  substring(“ABCDEF”,2,1) -> substring(“ABCDEF”,2,3)};
        

        Both maps will contain keys A,B,C and values ABC, BCD, CDE respectively.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              slamam Martin Slama
              Reporter:
              krivanekm Milan Krivanek
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 days
                  2d