|
Subject: "flattening arguments" Newsgroups: gmane.comp.lang.perl.perl6.language Date: 2005-06-05 13:32:03 GMT (4 years, 4 weeks, 2 days, 9 hours and 56 minutes ago)
Hi,
From the Perl6 and Parrot Essentials:
----- 8< -----
sub flat_hash ($first, $second) {
say "first: $first";
say "sec. : $second";
}
my %hash = (first => 1, second => 2);
flat_hash(*%hash);
----- 8< -----
It says, that "No compatible subroutine found". I've modyfied the
subroutine:
----- 8< -----
sub flat_hash (+$first, +$second) {
say "first: $first";
say "sec. : $second";
}
----- 8< -----
Now, I got:
first: first 1 second 2
sec. :
-----------------
I've tried it on the feather.perl6.nl machine, with pugs. Is it the
right behaviour?
Bye,
András
|
|
|