pugs-commits | 6 May 2010 20:01
Picon

r30566 - docs/Perl6/Spec

Author: lwall
Date: 2010-05-06 20:01:44 +0200 (Thu, 06 May 2010)
New Revision: 30566

Modified:
   docs/Perl6/Spec/S03-operators.pod
Log:
[S03] small clarifications to usage of brackets around infixes

Modified: docs/Perl6/Spec/S03-operators.pod
===================================================================
--- docs/Perl6/Spec/S03-operators.pod	2010-05-06 16:28:10 UTC (rev 30565)
+++ docs/Perl6/Spec/S03-operators.pod	2010-05-06 18:01:44 UTC (rev 30566)
 <at>  <at>  -15,8 +15,8  <at>  <at> 

     Created: 8 Mar 2004

-    Last Modified: 27 Apr 2010
-    Version: 202
+    Last Modified: 6 May 2010
+    Version: 203

 =head1 Overview

 <at>  <at>  -4575,8 +4575,8  <at>  <at> 

 =head2 Nesting of metaoperators

-Any ordinary infix operator may be enclosed in square brackets
-with the same meaning.  You may therefore use square brackets
+Anywhere you may use an ordinary infix operator, you may use the infix operator enclosed in square brackets
+with the same meaning.  (No whitespace is allowed.)  You may therefore use square brackets
 within a metatoken to disambiguate sequences that might
 otherwise be misinterpreted, or to force a particular order
 of application when there are multiple metaoperators in the metatoken:
 <at>  <at>  -4584,6 +4584,14  <at>  <at> 
      <at> a [X+]=  <at> b
      <at> a X[+=]  <at> b

+Since metatokens may never be disambiguated with internal whitespace,
+use of brackets is especially useful when the operator and its
+associated metaoperator share characters that would be confusing to the
+reader, even if not to the compiler:
+
+     <at> a >>>>> $b        # huh?
+     <at> a >>[>]>> $b      # oh yeah
+
 Any infix function may be referred to as a noun either by the normal long
 form or a short form using square brackets directly after the C<&> sigil:


Gmane