Associative array/Iteration: Difference between revisions

m (→‎Alternate solution: Remove vanity tags)
Line 795:
import extensions.
 
public program =
[
// 1. Create
Line 808:
aMap forEach
(:aKeyValue)[ console printLine(aKeyValue key," : ",aKeyValue value) ].
].</lang>
 
=== Strong typed dictionary ===
<lang elena>import system'collections.
import system'routines.
import extensions.
 
public program
[
// 1. Create
auto aMap := Map<literal,literal>().
aMap["key"] := "foox".
aMap["key"] := "foo".
aMap["key2"]:= "foo2".
aMap["key3"]:= "foo3".
aMap["key4"]:= "foo4".
 
// Enumerate
aMap forEach
(:tuple)[ console printLine(tuple item1," : ",tuple item2) ].
]</lang>
 
=={{header|Elixir}}==
Anonymous user