On 8/23/05, Ingo Blechschmidt <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> (asking because a test testing for the converse was just checked in to
> the Pugs repository [1])
> 
>     sub foo ($n, *%rest) {...}
> 
>     foo 13;
>     # $n receives 13, of course, %rest is ()
> 
>     foo 13, foo => "bar";
>     # $n receives 13 again, %rest is (foo => "bar")
> 
>     foo n => 13;
>     # $n receives 13, %rest is (), right?
> 
>     foo n => 13, foo => "bar";
>     # $n receives 13, %rest is (foo => "bar"), right?

Yep, that's all correct.  Matter of fact, what %rest actually gets has
not been defined. "Maybe %rest mirrors all the named arguments, maybe
it doesn't".  I can see a very small utility if it does, but it seems
like it would be faster[1] if it didn't.  I think it's fair to say no
here.

[1] Yeah, yeah, premature optimization and whatnot.  You always have
the sig (*%hash) if you really want to.

Luke

Reply via email to