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
[svn:perl6-synopsis] r13490 - doc/trunk/design/syn
by larry other posts by this author
Dec 13 2006 4:51PM messages near this date
| Re: Gather/Take and threads
Author: larry
Date: Wed Dec 13 17:50:39 2006
New Revision: 13490

Modified:
   doc/trunk/design/syn/S04.pod

Log:
Generalized the do/gather syntax to other similar dynamic scoping constructs.


Modified: doc/trunk/design/syn/S04.pod
==============================================================================
--- doc/trunk/design/syn/S04.pod	(original)
+++ doc/trunk/design/syn/S04.pod	Wed Dec 13 17:50:39 2006
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall <larry@[...].org> 
   Date: 19 Aug 2004
-  Last Modified: 5 Dec 2006
+  Last Modified: 13 Dec 2006
   Number: 4
-  Version: 45
+  Version: 46
 
 This document summarizes Apocalypse 4, which covers the block and
 statement syntax of Perl.
@@ -410,7 +410,18 @@
 statement or block, and executes it once.  Unlike C<do> , its return
 value is a specified by calling the C<take>  function one or more
 times within the dynamic scope of the gather.  The returned values are
-flattened into a lazy list.
+flattened into a lazy list.  A C<gather>  is not considered a loop.
+
+Other similar C<Code> -only forms may also take bare statements,
+including C<try> , C<contend>, C<async>, and C<lazy>.  These constructs
+establish a dynamic scope without necessarily establishing a lexical
+scope.  (You can always establish a lexical scope explicitly by using
+the block form of argument.)  As statement introducers, all these
+keywords must be followed by whitespace.  You can say something
+like C<try({...})> , but then you are calling it using function call
+syntax instead, in which case the C<Code>  argument must be a block.
+For purposes of flow control, none of these forms are considered loops,
+but they may easily be applied to a normal loop.
 
 =head1 Switch statements
 

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved