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

2007-03-12 Thread larry
Author: larry
Date: Mon Mar 12 13:30:46 2007
New Revision: 14339

Modified:
   doc/trunk/design/syn/S02.pod
   doc/trunk/design/syn/S03.pod
   doc/trunk/design/syn/S04.pod
   doc/trunk/design/syn/S06.pod

Log:
Various clarifications suggested by TheDamian++
Explicit pipe target is now @(*) or @@(*).
Separated clobbering == == from pushy == and ==
Pushy pipes can now be stacked on filters as well as sinks.
$?BLOCK and other contexts now consistently return a list of labels.


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podMon Mar 12 13:30:46 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 10 Aug 2004
-  Last Modified: 11 Mar 2007
+  Last Modified: 12 Mar 2007
   Number: 2
-  Version: 94
+  Version: 95
 
 This document summarizes Apocalypse 2, which covers small-scale
 lexical items and typological issues.  (These Synopses also contain
@@ -1648,7 +1648,7 @@
 @?ROUTINE   Which nested routines am I in?
 ?BLOCK Which block am I in?
 @?BLOCK Which nested blocks am I in?
-$?LABEL Which block label am I in?
+$?LABEL Which innermost block label am I in?
 @?LABEL Which nested block labels am I in?
 
 All the nested C@? variables are ordered from the innermost to the
@@ -2472,8 +2472,8 @@
 line number range within the source file.
 
 The lexical routine itself is C?ROUTINE; you can get its name with
-CROUTINE.name.  The current block is C?BLOCK.  If the block has a label,
-that shows up in C?BLOCK.label.  Within the lexical scope of
+CROUTINE.name.  The current block is C?BLOCK.  If the block has any
+labels, those shows up in C?BLOCK.labels.  Within the lexical scope of
 a statement with a label, the label is a pseudo-object representing
 the dynamic context of that statement.  (If inside multiple dynamic
 instances of that statement, the label represents the innermost one.)

Modified: doc/trunk/design/syn/S03.pod
==
--- doc/trunk/design/syn/S03.pod(original)
+++ doc/trunk/design/syn/S03.podMon Mar 12 13:30:46 2007
@@ -14,7 +14,7 @@
   Date: 8 Mar 2004
   Last Modified: 12 Mar 2007
   Number: 3
-  Version: 107
+  Version: 108
 
 =head1 Overview
 
@@ -50,7 +50,7 @@
 List prefix = : print push say die map substr ... [+] [*] any all
 Loose and   and
 Loose oror xor err
-Terminator  ; ==, ==, {...}, modifiers, unmatched ), ], }
+Terminator  ; ==, ==, ==, ==, {...}, modifiers, extra ), ], }
 
 If you don't see your favorite operator there, the following
 sections cover all the operators in precedence order.  Basic operator
@@ -1393,10 +1393,24 @@
 
 =item *
 
-Feed operators: ==, ==
+Feed operators: ==, ==, ==, ==
 
 source() == filter() == sink()
 
+The forms with the double angle append rather than clobber the sink's
+todo list.  The C ==  form always looks ahead for an appropriate
+target to append to, either the final sink in the chain, or the next
+filter stage with an explicit C@(*) or C@@(*) target.  This means
+you can stack multiple feeds onto one filter command:
+
+source1() ==
+source2() ==
+source3() ==
+filter(@(*)) == sink()
+
+Similar semantics apply to C ==  except it looks backward for
+an appropriate target to append to.
+
 =item *
 
 Control block: ws{...}
@@ -2521,7 +2535,7 @@
 
 $hacker.feed:xxx('Pizza and cola');
 
-is tokenized as an adverb applying to the method:
+is tokenized as an adverb applying to the method as its preceding operator:
 
 $hacker.feed :xxx('Pizza and cola');
 
@@ -2529,7 +2543,8 @@
 
 $hacker.feed: xxx('Pizza and cola');  # wrong
 
-If you want both meanings of colon, you have to put it twice:
+If you want both meanings of colon in order to supply both an adverb
+and some positional arguments, you have to put the colon twice:
 
 $hacker.feed: :xxx('Pizza and cola'), 1,2,3;
 
@@ -3366,27 +3381,30 @@
 
 =head1 Traversing arrays in parallel
 
-In order to support parallel iteration over multiple arrays, PerlĀ 6 has
-a Czip function that builds CSeq objects from the elements of two or more
-arrays.
+In order to support parallel iteration over multiple arrays, PerlĀ 6
+has a Czip function that builds a list of CSeq objects from the
+elements of two or more arrays.  In ordinary list context this behaves
+as a list of CCaptures and automatically flattens.
 
-for zip(@names; @codes) - [$name, $zip] {
+for zip(@names; @codes) - $name, $zip {
 print Name: $name;   Zip code: $zip\n;
 }
 
 Czip has an infix synonym, the CZ operator.
 
-To read arrays in parallel like Czip but just sequence the values
-rather than generating tuples, use Ceach instead of Czip.
+In an explicitly multidimensional list context, however, the sequences
+turn into subarrays, 

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

2007-03-12 Thread Smylers
[EMAIL PROTECTED] writes:

 Separated clobbering == == from pushy == and ==
 
 +Feeding into the C* whatever term sets the source for the next sink.
 +To append multiple sources to the next sink, double the angle:
 +
 +0..*   ==  *;
 +'a'..* == *;
 +pidigits() == *;

Can you append to something that isn't there?  Would it matter if the
first feed also had a double pointy bracket on it?

Smylers