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
Re: return() in pointy blocks
by Luke Palmer other posts by this author
Jun 7 2005 2:09PM messages near this date
Re: reduce metaoperator on an empty list | Re: return() in pointy blocks
On 6/7/05, Luke Palmer <lrpalmer@[...].com>  wrote:
>  Then let's put it this way:
>  
>     sub foo () {
>         for 0..10 {
>             when 6 { return 42 }
>         }
>         return 26;
>     }
>  
>  And if that didn't do it, then let's write it equivalently as:
>  
>     sub foo () {
>         &map(-> $_ { return 42 }, 0..10);
>         return 26;
>     }

Not that it's that important to the argument, but of course I mean:

     sub foo() { 
         &map(->  $_ { return 42 when 6 }, 0..10);
         return 26;
     }

Luke

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