Assignment

allows associating a name with an array value. Some dialects also allow assignment of function and operator values using the assignment arrow. In defined functions, assignment is global by default, but can be made local through explicit mention of the target name in the function header, or through dynamic shadowing using. In dfns, assignments are local by default, but can be made global by explicit mention of the target namespace. Modified/indexed/selective assignment updates the most local definition.

Basic usage
Common examples (boxing on, and index origin is 0):

Indexed assignment
Individual elements can be updated using index assignment: A semicolon is necessary when dealing with a matrix: For higher-rank arrays, the number of semicolons needed is one less than the array rank.

Modified assignment
Some dialects allow placing a function the the immediate left of the assignment arrow: is essentially equivalent to  except that the result is shy.

Modified indexed assignment
Modified assignment can also be combined with indexed assignment:

Function assignment
In modern dialects, the right hand side of assignment may be a function (or possibly an operator). This allows anonymous and tacit functions to be named.

Before the 1980s, only arrays could be assigned: defined functions included the function name in the header in order to associate it with the function, and derived functions could not be named directly. Instead the programmer would define a function that explicitly called that derived function on its arguments. Iverson's 1978 paper Operators and Functions used a new glyph, an assignment arrow with a bar above (that is, overstruck with a high minus), as Adin Falkoff objected to the use of the unmodified assignment arrow. However, Iverson used the assignment arrow directly in several papers he co-authored beginning in 1980. Function assignment was added to Dyalog APL in version 4.0 in 1986. It was a key feature of J, which supports only anonymous and tacit functions.

Documentation

 * Dyalog
 * APLX
 * J: local, global