( SYNTAX ERROR ( ∧ 'Hello world SYNTAX ERROR: Invalid token 'Hello world ∧
However, a SYNTAX ERROR may also indicate a problem not with the sequence of tokens in a statement, but with their meaning. For example, below an error results when a function is called with invalid valence: here, a monadic function with two arguments.
fn ← + 2 fn 3 5 fn ← +\ ⍝ A strictly monadic function 2 fn 3 SYNTAX ERROR: The function does not take a left argument 2 fn 3 ∧
Depending on the value of
fn, the same statement may or may not be considered invalid syntax. This is to be expected, since APL does not have a context-free grammar and needs to know the type of each variable to parse a statement.
|APL features |
|Built-ins||Primitives (functions, operators) ∙ Quad name|
|Array model||Shape ∙ Rank ∙ Depth ∙ Bound ∙ Index (Indexing) ∙ Axis ∙ Ravel ∙ Ravel order ∙ Element ∙ Scalar ∙ Vector ∙ Matrix ∙ Simple scalar ∙ Simple array ∙ Nested array ∙ Cell ∙ Major cell ∙ Subarray ∙ Empty array ∙ Prototype|
|Data types||Number (Boolean, Complex number) ∙ Character (String) ∙ Box ∙ Namespace ∙ Function array|
|Concepts and paradigms||Conformability (Scalar extension, Leading axis agreement) ∙ Scalar function (Pervasion) ∙ Identity element ∙ Complex floor ∙ Total array ordering ∙ Tacit programming (Function composition, Close composition) ∙ Glyph|
|Errors||LIMIT ERROR ∙ RANK ERROR ∙ SYNTAX ERROR ∙ DOMAIN ERROR ∙ LENGTH ERROR ∙ INDEX ERROR ∙ VALUE ERROR|