Author: larry
Date: Tue May 9 14:06:29 2006
New Revision: 9153
Modified:
doc/trunk/design/syn/S03.pod
Log:
Reduce in list context.
Modified: doc/trunk/design/syn/S03.pod
==============================================================================
--- doc/trunk/design/syn/S03.pod (original)
+++ doc/trunk/design/syn/S03.pod Tue May 9 14:06:29 2006
@@ -12,9 +12,9 @@
Maintainer: Larry Wall <[EMAIL PROTECTED]>
Date: 8 Mar 2004
- Last Modified: 1 May 2006
+ Last Modified: 9 May 2006
Number: 3
- Version: 26
+ Version: 27
=head1 Changes to existing operators
@@ -497,6 +497,15 @@
@args = (\%a,'foo','bar');
$x = [dehash] @args;
+In scalar context, a reduce operator returns only the final result, but
+in list context, the reduce operator also returns all intermediate results
+lazily:
+
+ say [+], 1..* # (1, 3, 6, 10, 15, ...)
+
+Unlike other reduction operators, the C<[;]> operator is not sensitive
+to list context.
+
=head1 Junctive operators
C<|>, C<&>, and C<^> are no longer bitwise operators (see L</Operator