Previous: vectors fold unfold, Up: vectors fold [Index]
All the functions described here map their proc function argument over all the elements of the vector arguments, or the subvector argument, from zero to the end in increasing order. In all the following descriptions:
!
,
build and return a new vector, storing into it the results of mapping
proc.
!
,
mutate their vec0 vector argument, storing into it the results of
mapping proc.
*
,
accept only vector arguments of equal length.
*
,
accept vector arguments of different length, stopping the iteration at
the end of the shortest.
/with-index
suffix, apply
their proc function argument as:
(proc (vector-ref vec0 idx) (vector-ref vec idx) ...)
/with-index
suffix, apply
their proc function argument as:
(proc idx (vector-ref vec0 idx) (vector-ref vec idx) ...)
where idx is the index of the current element.
Build and return a new vector holding the return values of mapping proc over all the elements of the vector arguments.
Mutate vec0 setting its elements to the return values of mapping proc over all the elements of the vector arguments.
Apply proc over all the elements of the vector arguments.
Build and return a new vector mapping proc over the items in the selected subvector of vec, from index start to index past in increasing order.
Mutate the selected subvector of vec, mapping proc over its items from index start to index past in increasing order.
Apply proc to each item in the selected subvector of vec, from index start to index past in increasing order.
Apply proc to each index in the selected subvector of vec, from index start to index past in increasing order. This is simply a method of looping over a vector that is guaranteed to be safe and correct.
The following syntaxes are like the corresponding functions. They can be a little faster when multiple vector arguments are present.
Like vector-map
and vector-map*
, but implemented as a
syntax.
Like vector-map!
and vector-map*!
, but implemented as a
syntax.
Like vector-for-each
and vector-for-each*
, but implemented
as a syntax.
Previous: vectors fold unfold, Up: vectors fold [Index]