summary refs log blame commit diff stats
path: root/tests/accept/compile/ttuple1.nim
blob: 5787cc3090c45f35ba6da3bac543b2169b9c6e5d (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16















                                                          
const romanNumbers = [
    ("M", 1000), ("D", 500), ("C", 100),
    ("L", 50), ("X", 10), ("V", 5), ("I", 1) ]

var c = 0
for key, val in items(romanNumbers):
  inc(c)
  stdout.write(key & "=" & $val)
  if c < romanNumbers.len: stdout.write(", ") else: echo""
#echo""

proc PrintBiTuple(t: tuple[k: string, v: int]): int =
  stdout.write(t.k & "=" & $t.v & ", ")
  return 0