|
||||||||||||
|
|
||||||||||||
ArraysArray has features of hashtable and list. While it is capable of effective random lookups with a key, it also retains a double-linked list of elements, in the order of insertion. An array is created with angle brackets, yielding a value of type anvil.lang.array. An empty array is generated with empty brackets. There may also be an extra comma after elements.
If the expression inside array is a mapping
`` Arrays may also be created using comprehension which will create an array containig all the elements (or mappings) evaluted in the right-most expression. array-expr := "[" array-mapping ("," array-mapping )* [","] "]" array-expr := "[" comprehension-foreach "]" array-mapping := exprkey ["=>" exprvalue ] comprehension-foreach := "foreach" "(" ... ")" comprehension comprehension-if ::= "if" "(" expr ")" comprehension comprehension := comprehension-foreach | comprehension-if | expr
|
||||||||||||
|
|
||||||||||||