Diff of /PDL/Book/Operations.pod [fe817c] .. [befffa] Maximize Restore

  Switch to side-by-side view

--- a/PDL/Book/Operations.pod
+++ b/PDL/Book/Operations.pod
@@ -27,72 +27,12 @@
 operators (like multiplication), the scalar is promoted to a PDL, 
 so the result is a PDL with appropriate threading.
 
+=for html  <img width=400 src="Operations/operator-precedence-table.png">
+
+ Operator Precedence Table for PDL.
+
+
 =head3 PDLs as boolean values; logicals and masks
-
-
-
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    | Prec.  |      Op.        | Associativity (side of first grouping)  | Action on perl scalars           | Action on PDLs                            |
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    |   1    |       ()        |                   NA                    | Grouping and function eval.      | Identical to perl scalars.                |
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    |   2    |       ->        |                  Left                   | Dereference a ref or a method    | Dereference a method or slice a PDL *     |
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    |   3    |     ++, --      |             Either (Unary)              | Increment/decrement in-place.    | Elementwise *                             |
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    |   4    |       **        |                 Right                   | Exponentiation                   | Elementwise                               |
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    |   5    |       !         |             Right (Unary)               | Logical negation                 | Elementwise                               |
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    |   5    |       ~         |             Right (Unary)               | Bitwise negation (bit flipping)  | Elementwise - gets coerced to long int.   |
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    |   5    |       \         |             Right (Unary)               | Reference operator               | Identical to perl scalars.                |
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    |   5    |      +, -       |             Right (Unary)               | Arithmetic no-op/negation        | Elementwise                               |
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    |   6    |     =~, !~      |                  Left                   | String operation binding         | Acts on stringified PDL                   |
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    |   7    |    *, /, %      |                  Left                   | Multiply, divide, and modulus    | Elementwise *                             |
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    |   7    |       x         |                  Left                   | Repetition operator              | Matrix multiplication *                   |
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    |   8    |      +,-        |                  Left                   | Addition and subtraction         | Elementwise                               |
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    |   8    |       .         |                  Left                   | String concatenation             | Acts on stringified PDL                   |
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    |   9    |     <<,>>       |                  Left                   | Bit-shift operator               | Elementwise - gets coerced to long int.   |
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    |  10    |     Named       |             Right (Unary.)              | Named operators - various        | Acts on stringified PDL *                 |
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    |  11    |  <, >, <=, >=   |                   NA                    | Arithmetic comparisons           | Elementwise *                             |
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    |  11    | lt, gt, le, ge  |                   NA                    | String (lexical) comparisons     | Forbidden                                 |
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    |  12    |  ==, !=, <=>    |                   NA                    | Arithmetic equivalence           | Elementwise *                             |
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    |  12    |  eq, ne, cmp    |                   NA                    | String equivalence               | Elementwise *                             |
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    |  13    |       &         |                  Left                   | Bitwise AND                      | Elementwise logical AND                   |
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    |  13    |      |,^        |                  Left                   | Bitwise OR and XOR               | Elementwise logical OR and XOR            |
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    |  14    |       &&        |                  Left                   | Lazy Boolean logical AND         | Scalar (rejects multi-element PDLs)       |
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    |  15    |       ||        |                  Left                   | Lazy Boolean logical OR          | Scalar (rejects multi-element PDLs)       |
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    |  16    |    .., ...      |                 (none)                  | Range operators                  | Acts on stringified PDL                   |
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    |  17    |       ?:        |            Right (Ternary)              | Ternary conditional operator     | L:Scalar; M,R: identical to perl scalars. |
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    |  18    |       =         |                 Right                   | Assignment                       | Assignment-by-reference *                 |
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    |  19    |    +=, etc.     |                 Right                   | In-place arithmetic modifiers    | Elementwise *                             |
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-    |  20    |      ,,=>       |                  Left                   | List separators                  | Identical to perl scalars *               |
-    +--------+-----------------+-----------------------------------------+----------------------------------+-------------------------------------------+
-
-
 
 PDLs can be used in Perl's I<boolean context>. As in the C and Perl 
 environments, values that are zero are treated as boolean FALSE, 
@@ -287,7 +227,7 @@
 
   $pdl = sequence(3,3);
   for $el( list $pdl ) {
-      print $el,���\n���;
+      print $el,"\n";
   }
 
 is an expensive way to print the integers from 0 through 8. The