Hi,
are the following assumptions correct?
sub foo (*@args) { @args[0] }
say ~foo("a", "b", "c"); # "a"
my @array = <a b c d>;
say ~foo(@array); # "a b c d" (or "a"?)
say ~foo(@array, "z"); # "a b c d" (or "a"?)
say ~foo(*@array); # "a"
say ~foo(*(@array, "z")); # "a"
sub bar (*@args) { +@args }
say bar(1,2,3); # 3
say bar(@array); # 1 (or 4?)
say bar(@array, "z"); # 2 (or 5?)
say bar(*@array); # 4
--Ingo
--
Linux, the choice of a GNU | There are no answers, only
generation on a dual AMD | cross-references.
Athlon! |
Thread Next