APL syntax

APL's syntax refers to the way programs are written—the arrangement of functions and arrays, along with other values, keywords, and punctuation—in contrast to its semantics, that is, the meaning of the actual operations performed. In part because of APL's close relationship with mathematical notation, its syntax can be very different from typical programming languages. Distinctive features of APL include its use of infix functions, evaluated right to left with no relative precedence ordering, and its division of arrays, functions, and operators into different syntactic as well as semantic classes.

Overview
APL's core syntactic principles are: A typical APL statement consists of an arrangement of the three types above, parentheses for grouping, and possibly assignment. While such individual statements may be enough for simple programming in a session, larger programs are constructed by defining functions, with control structures used to organize APL statements.
 * Arrays as first class citizens
 * Functions act on arrays and have long right scope ("right to left")
 * Operators act on functions or arrays and have long left scope ("left to right")

Syntactic elements
In most APLs, values in the language can have one of the following classes: Each of these values can usually be stored in a variable, either by assignment or function definition. Values of these types can also be written directly in many cases, with strings, numeric literals, or array notation, as predefined primitive functions and operators, or as inline dfns. There are some anomalies which do not fit easily into this system, such as Outer Product, which is written with two glyphs, and function-operator overloading.
 * Arrays, the fundamental type for program data
 * Functions, which can be called on arrays either monadically or dyadically
 * Monadic operators, which take a single function or array operand and produce a derived function
 * Dyadic operators, which take two operands and produce a derived function
 * Niladic functions, which are evaluated immediately to become one of the above values
 * In some APLs, hyperators continue the array-function-operator hierarchy.

Additionally, there are some syntactic elements that cannot be used as values:
 * The assignment arrow
 * Square brackets  used for bracket indexing and function axis specification
 * Parentheses  for grouping
 * The diamond and newline characters used as a statement separator
 * The del character  used for tradfns, or curly braces for dfns
 * Keywords for control structures
 * The branch arrow

The second group, consisting of fixed syntax written with particular tokens, is common to many programming languages (in fact, APL tends to have a simpler fixed syntax than many contemporary languages). However, the first group is unusual because it means that a variable's syntactic properties are determined by the variable's value and not just by how it's written. This property makes it impossible to parse an APL statement with variables in general: for example, the statement  could be a function application, two function applications, a function modified by an operator, and so on.