At 1:09 PM -0500 2/14/03, [EMAIL PROTECTED] wrote:
We could do that, but I'm not sure it's worth it. Here's a quick explanation of what I mean by named args.Dan --*) There's going to be a bunch of named argument stuff that we should (though don't have to) put support in for. Perl 6 is going to make heavy use of them.I may be terminologically challenged here (if so, please forgive), but this sounds like passing a single pad as *the* argument, so the pad gets inserted into the lookup chain.
With perl 6, you'll be able to have signatures like:
method foo($bar, $baz, @quux; $other) {}
which you can call either positionally or by name. A positional call would be:
object.foo(1, 2, @array)
and a named call would be:
object.foo(other => "Fred", quux => @array, bar => 1, baz => 2)
where the names of the parameters in the signature map to names on the LHS of the arrow. (Keeping in mind that the "foo => 1" construct builds a single pair object, rather than two scalars, and that arrays and hashes get passed as a single thing unless explicitly flattened) There are some rules for mixing positional and named parameters, which I need to dig out.
The end result is that it's the callee's responsibility to make the name->parameter mapping, not the caller, since you can't guarantee that you're not going to get intercepted and redirected to a method with a different signature, or with the same parameters in a different order.
--
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk