Next: Array Procedures, Up: Arrays
An array is displayed as #
followed by its rank, followed by a
tag that describes the underlying vector, optionally followed by
information about its shape, and finally followed by the cells,
organized into dimensions using parentheses.
In more words, the array tag is of the form
#<rank><vectag><@lower><:len><@lower><:len>...
where <rank>
is a positive integer in decimal giving the rank of
the array. It is omitted when the rank is 1 and the array is non-shared
and has zero-origin (see below). For shared arrays and for a non-zero
origin, the rank is always printed even when it is 1 to dinstinguish
them from ordinary vectors.
The <vectag>
part is the tag for a uniform numeric vector, like
u8
, s16
, etc, b
for bitvectors, or a
for
strings. It is empty for ordinary vectors.
The <@lower>
part is a `@' character followed by a signed
integer in decimal giving the lower bound of a dimension. There is one
<@lower>
for each dimension. When all lower bounds are zero,
all <@lower>
parts are omitted.
The <:len>
part is a `:' character followed by an unsigned
integer in decimal giving the length of a dimension. Like for the lower
bounds, there is one <:len>
for each dimension, and the
<:len>
part always follows the <@lower>
part for a
dimension. Lengths are only then printed when they can't be deduced
from the nested lists of elements of the array literal, which can happen
when at least one length is zero.
As a special case, an array of rank 0 is printed as
#0<vectag>(<scalar>)
, where <scalar>
is the result of
printing the single element of the array.
Thus,
#(1 2 3)
#@2(1 2 3)
#2((1 2 3) (4 5 6))
#u32(0 1 2)
#2u32@2@3((1 2) (2 3))
#2()
#2:0:2()
#0(12)