Skip to content

Instantly share code, notes, and snippets.

@melezhik
Created November 4, 2020 21:23
Show Gist options
  • Save melezhik/b1d4060e16b8d014b5e01615679ae4fa to your computer and use it in GitHub Desktop.
Save melezhik/b1d4060e16b8d014b5e01615679ae4fa to your computer and use it in GitHub Desktop.
$ raku -MData::Dump -e 'my @foo = Array.new; for 0 .. 2 -> $i { for 0 .. 2 -> $j { my $val = "i=$i AND j=$j"; @foo[$i].push: $val } }; say Dump(@foo[1..2][1..2], :color(False))'
[
[
"i=2 AND j=0".Str,
"i=2 AND j=1".Str,
"i=2 AND j=2".Str,
],
(Nil),
]
$ raku -MData::Dump -e 'my @foo = Array.new; for 0 .. 2 -> $i { for 0 .. 2 -> $j { my $val = "i=$i AND j=$j"; @foo[$i].push: $val } }; say Dump(@foo[1..2;1..2], :color(False))'
[
"i=1 AND j=1".Str,
"i=1 AND j=2".Str,
"i=2 AND j=1".Str,
"i=2 AND j=2".Str,
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment