Anonymous user
Associative array/Iteration: Difference between revisions
Updated to work without warning with version 1.4 of Nim.
(→{{header|AWK}}: gawk allows sorting) |
(Updated to work without warning with version 1.4 of Nim.) |
||
Line 2,207:
import tables
var t: Table[int,string]
t[1] = "one"
t[2] = "two"
t[3] = "three"
t
echo "t has " & $t.len & " elements"
Line 2,224:
echo "at[" & $k & "]=" & t[k]
#
echo "pair iteration:"
for k,v in t.pairs:
|