(rontolisp) docs
← Maps, sets and vectors

int-array

(int-array size-or-seq) (int-array size init-val-or-seq)

Answers an int array: of a number, that many zeros, else the members of a seq, each narrowed like Java's (int) (an integer's low 32 bits, a double or ratio truncated inside the int range). With size and an init, every element is the int init (any number), or the next member of the seq init (zeros past its end).

An array is a vector here, as one make-array makes: it reads through aget, writes through aset (which stores any value, where the oracle's reflection refuses one of another type), measures through alength, copies through aclone, and takes every seq verb, count, nth, get and = as a vector does. class answers :vector, str and pr print the vector, and = compares elements, where the oracle answers its classes, prints #object and compares by identity (deviations). Runs on every backend; as a value a function of one or two arguments.