Skip to content

Instantly share code, notes, and snippets.

@Tux
Created March 23, 2015 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tux/90b22dd241ab896cc392 to your computer and use it in GitHub Desktop.
Save Tux/90b22dd241ab896cc392 to your computer and use it in GitHub Desktop.
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