An array contains a set of objects called elements that can be referenced individually according to a rectilinear coordinate system.
Each dimension is a non-negative fixnum; if any dimension of an array is zero, the array has no elements. Maybe this part isn't in glossary...I just moved it from somewhere else per suggestion of Barmar. -kmp 14-Jan-92It 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.
array-dimension-limit.
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.
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.
17.5.0 4Only 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.
array-rank-limit.
The phrasing “an array specialized to type ⟪type⟫” is sometimes used to emphasize the element type of an array. This phrasing is tolerated even when the ⟪type⟫ is t, even though an array specialized to type t is a general array, not a specialized array.
The next figure lists some defined names that are applicable to array creation, access, and information operations.
Added ARRAY-DISPLACEMENT per Tom Shepard. (X3J13 approved: May 4-5, 1994) -kmp 9-May-94
Figure 15–1. General Purpose Array-Related Defined Names
Some of the following was transplanted from the description of UPGRADED-ARRAY-ELEMENT-TYPE. Consider also stealing from SUBTYPEP and TYPEP.
The upgraded array element type of a type is a type that is a supertype of and that is used instead of whenever is used as an array element type for object creation or type discrimination.
During creation of an array, the element type that was requested is called the expressed array element type. The upgraded array element type of the expressed array element type becomes the actual array element type of the array that is created.
!!! Barmar thinks this should be removed.Type upgrading implies a movement upwards in the type hierarchy lattice. A type is always a subtype of its upgraded array element type. Also, if a type is a subtype of another type , then the upgraded array element type of must be a subtype of the upgraded array element type of . Two disjoint types can be upgraded to the same type.
The upgraded array element type of a type is a function only of itself; that is, it is independent of any other property of the array for which will be used, such as rank, adjustability, fill pointers, or displacement. This next sentence is interesting, but is just Rationale, so is omitted.
The reason \term{rank} is included is because it would not
be consistently possible to displace \term{arrays} to those of differing
\term{rank} otherwise.The function upgraded-array-element-type can be used by conforming programs to predict how the implementation will upgrade a given type.
17.0.0 5Vectors whose elements are restricted to type character or a subtype of character are called strings. Strings are of type string. 18.0.0 7
18.0.0 4The next figure lists some defined names related to strings.
Strings are specialized arrays and might logically have been included in this chapter. However, for purposes of readability most information about strings does not appear in this chapter; see instead Chapter 16 (Strings).
18.0.0 5 paragraph duplicated in descriptions of string-equal and string= 18.0.0 6 paragraph duplicated in description of stringp
Figure 15–2. Operators that Manipulate Strings
Vectors whose elements are restricted to type bit are called bit vectors. Bit vectors are of type bit-vector. The next figure lists some defined names for operations on bit arrays.
bit | bit-ior | bit-orc2 |
bit-and | bit-nand | bit-xor |
bit-andc1 | bit-nor | sbit |
bit-andc2 | bit-not | |
bit-eqv | bit-orc1 |
Figure 15–3. Operators that Manipulate Bit Arrays
array System Classsimple-array Typevector System Classsimple-vector Typebit-vector System Classsimple-bit-vector Typemake-array Functionadjust-array Functionadjustable-array-p Functionaref Accessorarray-dimension Functionarray-dimensions Functionarray-element-type Functionarray-has-fill-pointer-p Functionarray-displacement Functionarray-in-bounds-p Functionarray-rank Functionarray-row-major-index Functionarray-total-size Functionarrayp Functionfill-pointer Accessorrow-major-aref Accessorupgraded-array-element-type Functionarray-dimension-limit Constant Variablearray-rank-limit Constant Variablearray-total-size-limit Constant Variablesimple-vector-p Functionsvref Accessorvector Functionvector-pop Functionvector-push, vector-push-extend Functionvectorp Functionbit, sbit Accessorbit-and, bit-andc1, bit-andc2, bit-eqv, bit-ior, bit-nand, bit-nor, bit-not, bit-orc1, bit-orc2, bit-xor Functionbit-vector-p Functionsimple-bit-vector-p Function