Given the code:
use v6;
sub speakhash (*%hash) {
say "%hash{}";
}
speakhash(1, 2, 3, 4, 5, 6);
I get the error:
Too many positional parameters passed; got 6 but expected 0
in 'speakhash' at line 3:slurphash.p6
in main program body at line 7:slurphash.p6
According to the UsingPerl6 draft document, "*%hash slurps all the
remaining unbound named arguments into a hash."
So, it looks to me as though the arguments given to the speakhash()
subroutine should be slurped into %hash. Regardless, it strikes me as
odd that Rakudo* seems to think that the subroutine should expect *0*
arguments.
So... clearly there's a problem here, but I'm not sure if it's with
Rakudo* or with my thinking. :-)
Any thoughts on this matter would be appreciated.
many thanks,
dha
--
David H. Adler - <[email protected]> - http://www.panix.com/~dha/
Why *isn't* there a Widget::Gonzo module?