Author: larry Date: Mon Oct 16 17:40:41 2006 New Revision: 13165 Modified: doc/trunk/design/syn/S03.pod doc/trunk/design/syn/S06.pod
Log: More undotty print/say from bsb++. Modified: doc/trunk/design/syn/S03.pod ============================================================================== --- doc/trunk/design/syn/S03.pod (original) +++ doc/trunk/design/syn/S03.pod Mon Oct 16 17:40:41 2006 @@ -12,7 +12,7 @@ Maintainer: Larry Wall <[EMAIL PROTECTED]> Date: 8 Mar 2004 - Last Modified: 10 Oct 2006 + Last Modified: 16 Oct 2006 Number: 3 Version: 72 @@ -1184,7 +1184,7 @@ Junctions work through subscripting: - print if @foo[any(1,2,3)] + doit() if @foo[any(1,2,3)] Junctions are specifically unordered. So if you say Modified: doc/trunk/design/syn/S06.pod ============================================================================== --- doc/trunk/design/syn/S06.pod (original) +++ doc/trunk/design/syn/S06.pod Mon Oct 16 17:40:41 2006 @@ -13,7 +13,7 @@ Maintainer: Larry Wall <[EMAIL PROTECTED]> Date: 21 Mar 2003 - Last Modified: 2 Oct 2006 + Last Modified: 16 Oct 2006 Number: 6 Version: 59 @@ -932,7 +932,7 @@ 'a'..* ==> @@foo; pidigits() ==> @@foo; - for zip(@@foo) { say } + for zip(@@foo) { .say } [0,'a',3] [1,'b',1] @@ -954,11 +954,11 @@ could be rewritten as: (0..*; 'a'..*; pidigits()) ==> my @@foo; - for @@foo.zip { say } + for @@foo.zip { .say } which is in turn equivalent to - for zip(0..*; 'a'..*; pidigits()) { say } + for zip(0..*; 'a'..*; pidigits()) { .say } A named receiver array is useful when you wish to feed into an expression that is not an ordinary list operator, and you wish to be @@ -972,25 +972,25 @@ have "cat" semantics. If you say (0..2; 'a'..'c') ==> my @tmp; - for @tmp { say } + for @tmp { .say } then you get 0,1,2,'a','b','c'. If you have a multidim array, you can ask for cat semantics explicitly with cat(): (0..2; 'a'..'c') ==> my @@tmp; - for @@tmp.cat { say } + for @@tmp.cat { .say } As we saw earlier, "zip" produces little arrays by taking one element from each list in turn, so (0..2; 'a'..'c') ==> my @@tmp; - for @@tmp.zip { say } + for @@tmp.zip { .say } produces [0,'a'],[1,'b'],[2,'c']. If you don't want the subarrays, then use C<each()> instead: (0..2; 'a'..'c') ==> my @@tmp; - for @@tmp.each { say } + for @@tmp.each { .say } and then you just get 0,'a',1,'b',2,'c'. This is good for