Common Mistakes¶
Forgetting parentheses with rank¶
⌽⍤1 M ⍝ WRONG: 1 and M form a strand used as the rank operand
(⌽⍤1) M ⍝ RIGHT: parentheses group the derived function
This is the most common mistake when using the rank operator. Always parenthesise (f⍤k).
Confusing reduce and compress¶
/ has two meanings depending on context:
- Operator (after a function glyph):
+/V-- reduce - Function (with a left argument):
1 0 1/V-- compress (replicate)
Shape mismatch in dyadic functions¶
Dyadic scalar functions require matching shapes (or one argument must be a scalar):
Expecting nested arrays¶
MARPLE has flat arrays only. You cannot put an array inside an array:
Use the rank operator instead of Each (¨):
Index origin confusion¶
MARPLE defaults to ⎕IO←1. If you are used to 0-origin:
Right-to-left evaluation¶
APL evaluates right to left. This catches many newcomers:
Confusing assignment with comparison¶
← is assignment, = is comparison:
Name class conflicts¶
You cannot reuse a name that holds a function to store an array, or vice versa: