ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl6-language
perl6-language
"flattening arguments"
by B=C1RTH=C1ZI_Andr=E1s other posts by this author
Jun 5 2005 6:34AM messages near this date
Re: Quick questions: multi submethod and undef.method | Re: "flattening arguments"
Hi,

 From the Perl6 and Parrot Essentials:

----- 8< -----
sub flat_hash ($first, $second) {
     say "first: $first";
     say "sec. : $second";
}

my %hash = (first =>  1, second => 2);

flat_hash(*%hash);
----- 8< -----

It says, that "No compatible subroutine found". I've modyfied the 
subroutine:

----- 8< -----
sub flat_hash (+$first, +$second) {
     say "first: $first";
     say "sec. : $second";
}
----- 8< -----

Now, I got:

first: first 1 second 2
sec. :

-----------------

I've tried it on the feather.perl6.nl machine, with pugs. Is it the 
right behaviour?

Bye,
   András
Thread:
B=C1RTH=C1ZI_Andr=E1s
Stuart Cook

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved