Last active
July 19, 2018 17:12
-
-
Save donpdonp/539e49d076a62b3221c4bcff8e406f7c to your computer and use it in GitHub Desktop.
perl6 syntax weirdness
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> my $a = {a=>"A", b=>"B"} | |
{a => A, b => B} | |
> to-json $a | |
{ | |
"a": "A", | |
"b": "B" | |
} | |
> to-json [$a] # array of length 1 | |
[ | |
{ | |
"a": "A", | |
"b": "B" | |
} | |
] | |
> to-json [{a=>"A", b=>"B"}] # array of length 2 - error | |
[ | |
{ | |
"a": "A" | |
}, | |
{ | |
"b": "B" | |
} | |
] | |
> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment