Open
Description
import gara
proc mymain() =
let a = ("a", "b", "c")
match a:
("a",):
echo a, " matches 1-tuple"
("a", "b"):
echo a, " matches 2-tuple"
("a", "b", "c"):
echo a, " matches 3-tuple"
mymain()
output:
("a", "b", "c") matches 2-tuple
expected output:
("a", "b", "c") matches 3-tuple
Writing a matcher that is too long for the tuple fails to compile.
import gara
proc mymain() =
let a = ("a", "b", "c")
match a:
("a",):
echo a, " matches 1-tuple"
("a", "b"):
echo a, " matches 2-tuple"
("a", "b", "c"):
echo a, " matches 3-tuple"
("a", "b", "c", "d"):
echo a, " mathces 4-tuple"
mymain()
output:
/home/arne/proj/nim/Nim/pkgstemp/gara/src/gara.nim(33, 15) Error: invalid index value for tuple subscript
Metadata
Metadata
Assignees
Labels
No labels