array
module reference
array
module reference
Utilities for dealing with arrays.
index
- Concatenate Arrays.
- Index into an array.
- Get the first element from an array.
- Insert a new value into an array.
- Apply an function to each value in an array.
- Prepend a new value at the start of an array.
- Remove a value from an Array.
- Update a value in an array.
- Get the size of an array.
- Get everything except the first element from an array.
details
- Concatenate Arrays.
(concat arr1 arr2 [arr3…])
- Index into an array.
(get array i)
Get the value at index
i
(starting at 0).i
has to be a constant expression. - Get the first element from an array.
(head array)
- Insert a new value into an array.
(insert array i val)
Insert
val
intoarray
ati
, moving other values back if necessary.i
has to be a constant expression. This is a pure op, so at most one ofarray
andval
may be a !-stream. - Apply an function to each value in an array.
(map array fn)
Invokes
fn
once for each element inarray
and returns an array of the results.fn
must take one argument and return the same type consistently. - Prepend a new value at the start of an array.
(prepend array val)
Prepend
val
toarray
at index0
, moving other values back.This is a pure op, so at most one of
array
andval
may be a !-stream. - Remove a value from an Array.
(remove array i)
Removes the value at index
i
fromarray
.i
has to be a constant expression. - Update a value in an array.
(set array i val)
Set the value for
i
toval
.i
has to be a constant expression. This is a pure op, so at most one ofarray
andval
may be a !-stream. - Get the size of an array.
(size array)
- Get everything except the first element from an array.
(tail array)