Changes between Version 4 and Version 5 of Literals
- Timestamp:
- 01/15/11 12:24:08 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Literals
v4 v5 5 5 6 6 == List Literals == 7 List contents comma separated, collection [] delimited. 7 Dynamically sized heterogenous content data structures. 8 9 List contents are comma separated, collection is [] delimited. 8 10 9 11 Empty list is [] … … 20 22 }}} 21 23 22 == Map/Dictionary Literals == 23 Key and value colon separated, each entry comma separated, collection {} delimited. 24 == !Map/Dictionary Literals == 25 Also known as associative arrays or Dictionaries (Dicts).[[BR]] 26 27 Key and value is colon separated, each entry comma separated, collection is {} delimited. 24 28 25 29 empty map is {:}. … … 38 42 39 43 == Set Literals == 40 Values comma separated, collection {} delimited. 44 Unordered hashed collection of unique items optimized for membership testing and set operations. 45 46 Values are comma separated, collection is {} delimited. 41 47 42 48 Empty set is {}. … … 54 60 }}} 55 61 62 63 == Array Literals == 64 Statically sized homogenous content data structure. 65 66 Values are comma separated, collection is [] delimited with an '@' prefix. 67 68 Empty array is @[] 69 70 e.g 71 {{{ 72 #!cobra 73 names = @[ 'mike', 'gary', 'pat', 'bruce', 'paul'] # String[] or Array<of String> 74 heads = @[3,1,1,1,1] # int[] or Array <of int> 75 heads[4] = 3 76 77 }}} 78 79 Lists are probably easier to use and more flexible but for some purposes arrays have better performance. 56 80 57 81 == Numeric Literals == … … 96 120 }}} 97 121 122 == String Literals == 123 124 See [wiki:Strings] 125 126 127 98 128 [wiki:LanguageTopics Back to LanguageTopics]