Associative array/Iteration: Difference between revisions

m
Line 832:
 
=== Strong typed dictionary ===
<lang elena>import system'collections.;
import system'routines.;
import extensions.;
 
public program()
{
[
// 1. Create
auto aMapmap := new Map<literalstring,literalstring>().;
aMapmap["key"] := "foox".;
aMapmap["key"] := "foo".;
aMapmap["key2"]:= "foo2".;
aMapmap["key3"]:= "foo3".;
aMapmap["key4"]:= "foo4".;
 
// Enumerate
aMap map.forEach:
(:tuple)[{ console .printLine(tuple item1.Item1," : ",tuple item2.Item2) ].}
]}</lang>
 
=={{header|Elixir}}==
Anonymous user