develooper Front page | perl.perl6.language | Postings from August 2006

[svn:perl6-synopsis] r11155 - doc/trunk/design/syn

From:
larry
Date:
August 18, 2006 17:57
Subject:
[svn:perl6-synopsis] r11155 - doc/trunk/design/syn
Message ID:
20060819005709.CFFEBCB9BB@x12.develooper.com
Author: larry
Date: Fri Aug 18 17:57:09 2006
New Revision: 11155

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

Log:
List comprehensions via junctional syntax.


Modified: doc/trunk/design/syn/S09.pod
==============================================================================
--- doc/trunk/design/syn/S09.pod	(original)
+++ doc/trunk/design/syn/S09.pod	Fri Aug 18 17:57:09 2006
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall <larry@wall.org>
   Date: 13 Sep 2004
-  Last Modified: 26 July 2006
+  Last Modified: 18 Aug 2006
   Number: 9
-  Version: 12
+  Version: 13
 
 =head1 Overview
 
@@ -603,6 +603,22 @@
 in fact scalar parameters, though, so you could pass a junction of
 array or hash objects.)
 
+For junctions used with chained operators in a list context, the resulting
+value will be a subset of the first C<any> used in comparison:
+
+    for 0 <= any(@x) < all(@y) {...}
+
+will use only those values from C<@x> that satisfy the constraint.
+Usually junctions do not guarantee order of evalution, but in
+this particular case, the original ordering C<@x> is guaranteed to
+be preserved in the returned list.  In particular,
+
+    @result = any(@x) ~~ {...};
+
+is equivalent to
+
+    @result = grep {...}, @x;
+
 =head1 Parallelized parameters and autothreading
 
 Within the scope of a C<use autoindex> pragma (or equivalent, such as



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About