On 22/08/05, Luke Palmer <[EMAIL PROTECTED]> wrote:
> Output?
> 
>     sub foo (+$a, *%overflow) {
>         say "%overflow{}";
>     }
> 
>     foo(:a(1), :b(2));                       # b        2
>     foo(:a(1), :overflow{ b => 2 });         # b        2

I would have thought:
overflow       b       2
i.e. %overflow<overflow> = (b => 2)

Because :overflow() is an unrecognised named argument, so it goes in the slurpy
hash.  The fact that the hash has the same name as the argument is a
coincidence--does it make sense to explicitly name a slurpy when you can just
splat *{ b => 2 } in directly?

>     foo(:a(1), :overflow{ b => 2 }, :c(3));  # ???

overflow       b       2
c              3

Of course, that's just my way of thinking.

(Also, last I heard you /could/ have multiple slurpy hashes, but any after the
first would always be empty.)


Stuart

Reply via email to