On Thu, Mar 03, 2005 at 10:25:30AM -0500, Abhijit Mahabal wrote:
: Another edge case: is it legal to have an optional Pair in the
: signature? That is:
: sub foo($x, Pair ?$y, +$z){...}
:
: If yes, what does this parse as:
: foo(10, z => 5);
It ends up equivalent to foo(10, y => (z =
Another edge case: is it legal to have an optional Pair in the
signature? That is:
sub foo($x, Pair ?$y, +$z){...}
If yes, what does this parse as:
foo(10, z => 5);
If z => 5 is bound to $y, then $y is almost mandatory. ('almost' because
we can still say foo(10); ). (and then can we als
On Thu, Mar 03, 2005 at 01:03:07AM -0500, Abhijit Mahabal wrote:
: I was thinking about how binding of arguments to parameters in a
: sub/method call would happen. Seems to be a darn tricky thing with all
: sorts of potential pitfalls!
:
: I have a few questions. Consider the following piece of
I was thinking about how binding of arguments to parameters in a
sub/method call would happen. Seems to be a darn tricky thing with all
sorts of potential pitfalls!
I have a few questions. Consider the following piece of code. Are my
expectations correct?
sub foo($x, $y, *%slurp) { $x + $y }
s