develooper Front page | perl.perl6.language | Postings from August 2005

Calling positionals by name in presence of a slurpy hash

Thread Next
From:
Ingo Blechschmidt
Date:
August 23, 2005 06:33
Subject:
Calling positionals by name in presence of a slurpy hash
Message ID:
def8eg$36u$1@sea.gmane.org
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?


--Ingo

[1] http://svn.openfoundry.org/pugs/t/subroutines/slurpy_param.t 

-- 
Linux, the choice of a GNU | Row, row, row your bits, gently down the
generation on a dual AMD   | stream...  
Athlon!                    | 


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About