Details
-
Story
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
Security Level: Users (General product issues)
-
5
-
UNDECIDED
-
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
1.
|
Port changes from CTL improvements branch |
|
Closed | Roland Botka | ||||||||
2.
|
Add automated tests |
|
Closed | Martin Predny (Inactive) |
|
|||||||
3.
|
Update documentation |
|
Closed | Milan Krivanek |
|
|||||||
4.
|
Syntax highlighter for map and list |
|
Closed | Roland Botka | ||||||||
5.
|
Fix test for records in initializers |
|
Closed | Jano Michalica (Inactive) |