{{true, true}, {true, false}}
can't be parsed.
This is because {{ ... }}
is a macro expression. You need to use a few spaces:
{ {true, true}, {true, false} }
I think this will bite a few people, maybe the compiler should try to detect this and emit an error.
@RX14 excellent idea!
Now the error given is this:
Syntax error in ./foo.cr:1: expecting token ',', not '}'
If you are nesting tuples or hashes you must write them like this:
{ {x, y}, {z, w} } # Note the space after the first curly brace
because {{...}} is parsed as a macro expression.
{{1, 2}, {3, 4}}
^
Most helpful comment
@RX14 excellent idea!
Now the error given is this: