in S06
List parameters section
sub duplicate($n, *%flag, *@data) {...}
duplicate(3, reverse => 1, collate => 0, 2, 3, 5, 7, 11, 14);
duplicate(3, :reverse, :collate(0), 2, 3, 5, 7, 11, 14); # same
Should the example changed to?
sub duplicate($n, *%flag, *@data) {...}
duplicate(3, flag => { reverse => 1, collate => 0 }, 2, 3, 5, 7, 11, 14);
duplicate(3, flag => { :reverse, :collate(0) }, 2, 3, 5, 7, 11, 14); # same
duplicate(3, flag => { reverse => 1 }, collate => 0, 2, 3, 5, 7, 11,
14); #error
duplicate(3, flag => { :reverse }, :collate(0), 2, 3, 5, 7, 11 ); # error.
Otherwise, I might confuse many newbie just like I do.
Thanks,
Xinming
I think the simplest thing is to say that you can't bind to the name
of the slurpy hash. You give a name to it so that you can refer to it
inside, but that name is not visible to binding. (We could probably
say the same thing for other slurpy types, I suspect--especially if
it would simplify the binding code.)
Larry
Fixed in https://svn.perl.org/perl6/doc. Thanks.
Luke