Associative array/Iteration: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (→Alternate solution: Remove vanity tags) |
|||
Line 795: | Line 795: | ||
import extensions. |
import extensions. |
||
public program |
public program |
||
[ |
[ |
||
// 1. Create |
// 1. Create |
||
Line 808: | Line 808: | ||
aMap forEach |
aMap forEach |
||
(:aKeyValue)[ console printLine(aKeyValue key," : ",aKeyValue value) ]. |
(: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}}== |
=={{header|Elixir}}== |