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 "TSa (Thomas Sandlaß)" other posts by this author
Jul 4 2005 10:01AM messages near this date
Re: return() in pointy blocks | Re: return() in pointy blocks
Larry Wall wrote:
>  On Wed, Jun 08, 2005 at 12:37:22PM +0200, "TSa (Thomas SandlaÃ?)" wrote:
>  : BTW, is -> on the 'symbolic unary' precedence level
>  : as its read-only companion \ ?.
>  
>  No, -> introduces a term that happens to consist of a formal signature
>  and a block.  There are no ordinary expressions involved until you
>  get inside the block.  (Or set a default on one of the parameters, to
>  the extent that those are ordinary expressions.)

So without a block there is a syntax error?

   $x = ->  $y;

Or could this be understood as a short form of

   $x = ->  { $y } # $y from outer scope

I still think the pointy looks really cute as a prefix operator
for constructing rw refs. Especially if we use () to evaluate
the blockref returned. For plain variable assignment this is
not overly usefull because it amounts to the same as

   $x := $y;

but in lists it is quite nice

   %h = { foo, 'bar', blah, ->  $y };

or not?

   %h = { foo =>  'bar', blah => -> $y };

hmm, can the following be interpreted as spoiling pair notation?

   %h = { :foo<bar> , :blah< -> $y> }; # would blah<-> $y> parse at all?

I think not because this works

   %h = { :foo<bar> , :blah{-> $y} };

Regards,
-- 
TSa (Thomas SandlaÃ?)
Thread:
Ingo Blechschmidt
Matt Fowles
Luke Palmer
=22TSa_=28Thomas_Sandla=DF=29=22
=22TSa_=28Thomas_Sandla=DF=29=22
Larry Wall
"TSa (Thomas Sandlaß)"
Larry Wall
Matt Fowles

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