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 <[EMAIL PROTECTED]> 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