Prototype

In the nested array model, an array's prototype is an array which gives information about the type and structure of its elements. It is derived from the first element of the array in ravel order, or, if the array is empty, from information stored alongside the array (usually this information is just the prototype itself). An array's prototype is used as a fill element for operations involving that array.

APLs with a flat array model do not typically store prototype information, instead using only the array's type (character, numeric, or boxed) to determine its fills.

Examples
The prototype is used when an array is expanded or when empty elements are inserted in some other way. Take and Expand on a character array produce an array with spaces, because  is the prototype of a character array:

The Rank operator combines its left operand's result cells by extending them to a common shape like Mix does. Numeric vectors of different lengths will be expanded with, the prototype for a simple numeric array.

An array's prototype is based on its first element, so the array  below has a simple numeric prototype, as does any prefix of. This property even applies to empty arrays: the expression  results in an empty array with the same prototype as.

The prototype of an array may be nested. Here, we inspect the prototype of an array containing both character and numeric data. In the prototype, all characters are converted to spaces and all numbers to zeros. Thus the prototype retains type and structure information but not specific values.