Luke Palmer wrote:
> The idea is that positional parameters are always a contiguous
> sequence in the argument list. If it looked like this:
>
> sub foo($x, ?$y, +$k, [EMAIL PROTECTED]) {...}
>
> Then one might presume to call it like:
>
> foo($x, $y, $k, 1, 2, 3);
>
> Which they can't. So it makes sense to have everything positional up
> front, while things that can go anywhere (but must be labeled) in the
> back.
I guess. The most confusing part is this:
sub foo($x, +$k, [EMAIL PROTECTED]) {...} # (1) WRONG
sub foo($x, [EMAIL PROTECTED], +$k) {...} # (2) OK
sub foo($x, +$k, *%h) {...} # (3) OK(?)
sub foo($x, *%h, +$k) {...} # (4) WRONG(?)
Not only are (1) and (4) wrong, but they're always wrong... AFAICT, there's
no possible way to get $k correctly if you use those two forms. (Or maybe
it's (1) and (3) that are wrong, or maybe both (3) and (4) are OK and only
(1) is wrong; it depends on whether *%h is considered 'positional' or
'named'. I'm not even remotely sure.)
So I would emphatically hope that (1) and (4) produce compile-time errors,
at minimum. If we wanted to silently accept (1) and (4) as synonyms for
(2) and (3), that would be OK too.
But PLEASE, PLEASE make them compile-time errors if they aren't going to
work!
MikeL