Next: , Up: Array Concepts


15.1.1 Array Elements

An array contains a set of objects called elements that can be referenced individually according to a rectilinear coordinate system.

15.1.1.1 Array Indices

An array element is referred to by a (possibly empty) series of indices. The length of the series must equal the rank of the array. Each index must be a non-negative fixnum less than the corresponding array dimension. Array indexing is zero-origin.

15.1.1.2 Array Dimensions

An axis of an array is called a dimension.

Each dimension is a non-negative fixnum; if any dimension of an array is zero, the array has no elements. It is permissible for a dimension to be zero, in which case the array has no elements, and any attempt to access an element is an error. However, other properties of the array, such as the dimensions themselves, may be used.

15.1.1.2.1 Implementation Limits on Individual Array Dimensions

An implementation may impose a limit on dimensions of an array, but there is a minimum requirement on that limit. See the variable array-dimension-limit.

15.1.1.3 Array Rank

An array can have any number of dimensions (including zero). The number of dimensions is called the rank.

If the rank of an array is zero then the array is said to have no dimensions, and the product of the dimensions (see array-total-size) is then 1; a zero-rank array therefore has a single element.

15.1.1.3.1 Vectors

An array of rank one (i.e., a one-dimensional array) is called a vector.

15.1.1.3.1.1 Fill Pointers

A fill pointer is a non-negative integer no larger than the total number of elements in a vector. Not all vectors have fill pointers. See the functions make-array and adjust-array.

An element of a vector is said to be active if it has an index that is greater than or equal to zero, but less than the fill pointer (if any). For an array that has no fill pointer, all elements are considered active.

Only vectors may have fill pointers; multidimensional arrays may not. A multidimensional array that is displaced to a vector that has a fill pointer can be created.

15.1.1.3.2 Multidimensional Arrays
15.1.1.3.2.1 Storage Layout for Multidimensional Arrays

Multidimensional arrays store their components in row-major order; that is, internally a multidimensional array is stored as a one-dimensional array, with the multidimensional index sets ordered lexicographically, last index varying fastest.

15.1.1.3.2.2 Implementation Limits on Array Rank

An implementation may impose a limit on the rank of an array, but there is a minimum requirement on that limit. See the variable array-rank-limit.