(rontolisp) docs
← Maps, sets and vectors

short-array

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

Answers a short array: of a number, that many zeros, else the members of a seq, each narrowed like Java's (short) of its intValue (so 100000 is -31072). With size and an init, every element is the short init -- an integer in the short range (a Short is an integer here, where the oracle fills only for one) -- 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.