Author: larry
Date: Wed Apr  5 16:30:06 2006
New Revision: 8565

Modified:
   doc/trunk/design/syn/S03.pod

Log:
More clarification of how reduce is parsed.


Modified: doc/trunk/design/syn/S03.pod
==============================================================================
--- doc/trunk/design/syn/S03.pod        (original)
+++ doc/trunk/design/syn/S03.pod        Wed Apr  5 16:30:06 2006
@@ -300,9 +300,24 @@
 argument as a scalar even if the aliased function would have parsed it
 as a list:
 
-    &infix:<dehash> ::= postcircumfix:<{}>;
+    &infix:<dehash> ::= postcircumfix:<{ }>;
     $x = [dehash] $a,'foo','bar';  # $a<foo><bar>, not $a<foo bar>
 
+Note that, because a reduce is a list operator, the argument list to is
+evaluated in list context.  Therefore the following would be incorrect:
+
+    $x = [dehash] %a,'foo','bar';
+
+You'd instead have to say one of:
+
+    $x = [dehash] \%a,'foo','bar';
+    $x = [dehash] %a<foo>,'bar';
+
+On the plus side, this works without a star:
+
+    @args = (\%a,'foo','bar');
+    $x = [dehash] @args;
+
 =head1 Junctive operators
 
 C<|>, C<&>, and C<^> are no longer bitwise operators (see L</Operator

Reply via email to