The following macros evaluate to procedures that can be used to manipulate primitive Java array objects. The compiler can inline each to a single bytecode instruction (not counting type conversion).
Syntax: primitive-array-new
element-type
Evaluates to a one-argument procedure. Applying the resulting procedure to an integer count allocates a new Java array of the specified length, and whose elements have type
element-type
.
Syntax: primitive-array-set
element-type
Evaluates to a three-argument procedure. The first argument of the resulting procedure must be an array whose elements have type
element-type
; the second argument is an index; and the third argument is a value (coercible toelement-type
) which replaces the value specified by the index in the given array.