Creating User-Defined Functions
APL built-in (primitive) functions are powerful and priceless but they can do only that much. For everything else, you should write user-defined functions. Technically, they are programmer-defined, but back in the 1960s there was little difference between users and programmers.
Define and Call Functions
An APL function definition consists of the function name, optional result, up to two formal arguments, global and optional local variables, and a body. A definition begins and ends with the symbol ∇ (“nabla” or “del”). Let’s create a function that takes no arguments (a niladic function) and returns nothing. Such a function manipulates, and is manipulated through, only the global variables. Our first function, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access