Previous Next Contents

13. Arrays

The function make-array makes an array. The aref function accesses its elements. All elements of an array are initially set to nil. For example:

> (make-array '(3 3))
#2a((NIL NIL NIL) (NIL NIL NIL) (NIL NIL NIL))
> (aref * 1 1)
NIL
> (make-array 4)        ;1D arrays don't need the extra parens
#(NIL NIL NIL NIL)

Array indices always start at 0.

See below for how to set the elements of an array.


Previous Next Contents