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 Piers Cawley other posts by this author
Jun 8 2005 2:32PM messages near this date
Re: Musing on registerable event handlers for some specific events | This week's summary
"TSa (Thomas Sandlaß)" <Thomas.Sandlass@[...].com>  writes:

>  Piers Cawley wrote:
> > [..] then I think it means we can write:
> >     sub call-with-current-continuation(Code $code) {
> >         my $cc = -> $retval { return $retval }
> 
>  For the records: the return here is the essential ingredient, right?
>  Without it the block would be evaluated or optimized away to an undef
>  or some such.

Yes. Without the return you just get block that returns the value its last
expresion to the place from which it (the pointy sub) was called, rather than
to the place that the subroutine that created it was called from.

> 
> >         $code($cc);
> >     }
> > Which I personally think is rather cute.
> 
>  Me too!
> 
> 
> > Even if I can't quite bring myself to
> > believe it's that simple... 
> 
>  I have convinced myself.
>  How can I be of assistance on your side?

How's your Haskell?

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