Author: larry Date: Wed Apr 5 16:21:23 2006 New Revision: 8564 Modified: doc/trunk/design/syn/S02.pod doc/trunk/design/syn/S03.pod
Log: Additional clarifications on how to reduce non-infix ops. Modified: doc/trunk/design/syn/S02.pod ============================================================================== --- doc/trunk/design/syn/S02.pod (original) +++ doc/trunk/design/syn/S02.pod Wed Apr 5 16:21:23 2006 @@ -84,7 +84,8 @@ To be future proof, though, you should omit the space or use dot. (A consequence of this rule is that a dot with whitespace in front of it -is always considered a method call on C<$_>.) +is always considered a method call on C<$_>. If a term is not expected at +this point, it is a syntax error.) =item * Modified: doc/trunk/design/syn/S03.pod ============================================================================== --- doc/trunk/design/syn/S03.pod (original) +++ doc/trunk/design/syn/S03.pod Wed Apr 5 16:21:23 2006 @@ -295,6 +295,14 @@ for an operation can call C<infix:{$opname}()> to discover it. (There is no explicit identity property.) +To call some other non-infix function as a reduce operator, you must +define an alias in infix form. The infix form will parse the right +argument as a scalar even if the aliased function would have parsed it +as a list: + + &infix:<dehash> ::= postcircumfix:<{}>; + $x = [dehash] $a,'foo','bar'; # $a<foo><bar>, not $a<foo bar> + =head1 Junctive operators C<|>, C<&>, and C<^> are no longer bitwise operators (see L</Operator