Modified:
doc/trunk/design/syn/S04.pod
doc/trunk/design/syn/S06.pod
Log:
C<gather> now allows any statement, just like C<do>.
Modified: doc/trunk/design/syn/S04.pod
==============================================================================
--- doc/trunk/design/syn/S04.pod (original)
+++ doc/trunk/design/syn/S04.pod Tue Dec 5 17:19:40 2006
@@ -12,9 +12,9 @@
Maintainer: Larry Wall <la...@wall.org>
Date: 19 Aug 2004
- Last Modified: 16 Oct 2006
+ Last Modified: 5 Dec 2006
Number: 4
- Version: 44
+ Version: 45
This document summarizes Apocalypse 4, which covers the block and
statement syntax of Perl.
@@ -406,6 +406,12 @@
explicit because it's not out front where it can be seen. You can, of
course, use a placeholder parameter if you also use C<return>.)
+A variant of C<do> is C<gather>. Like C<do>, it is followed by a
+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.
+
=head1 Switch statements
A switch statement is a means of topicalizing, so the switch keyword
Modified: doc/trunk/design/syn/S06.pod
==============================================================================
--- doc/trunk/design/syn/S06.pod (original)
+++ doc/trunk/design/syn/S06.pod Tue Dec 5 17:19:40 2006
@@ -2432,10 +2432,8 @@
or more succinctly (and lazily):
sub pair (*@LIST) {
- gather {
- for @LIST -> $key, $val {
- take $key => $val;
- }
+ gather for @LIST -> $key, $val {
+ take $key => $val;
}
}