Created
March 23, 2015 17:04
-
-
Save Tux/90b22dd241ab896cc392 to your computer and use it in GitHub Desktop.
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
use v6; | |
use Slang::Tuxic; | |
class C { | |
method foo (Any :$in) { | |
my IO $io-in; | |
# in | |
# parse | |
# "file.csv" Str | |
# $io IO::Handle | |
# \"str,ing" Capture | |
# generate | |
# [[1,2],[3,4]] AoA Array | |
# [{1,2},{3,4}] AoH Array | |
# [1=>2,3=>4] AoP Array | |
# sub { ... } Sub | |
$in.WHAT.say; | |
$in.perl.say; | |
given $in.WHAT { | |
when Str { | |
$io-in = open $in, :r, chomp => False; | |
}; | |
when Array { | |
my @in = $in; | |
@in[0].WHAT.say; | |
}; | |
when Routine { | |
}; | |
default { | |
die "5000: error"; | |
}; | |
} | |
} | |
} | |
C.new.foo(in => "test.csv"); | |
Without Slang::Tuxic, PASS | |
With Slang::Tuxic: | |
===SORRY!=== Error while compiling T.pl | |
Missing block | |
at T.pl:33 | |
------> }⏏<EOL> | |
expecting any of: | |
parameterized block |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment