Next: , Previous: , Up: vectors   [Index]


24.8 Selection

Function: %vector-copy vec start past
Macro: subvector* V
Macro: vector-copy V

Build and return a new vector holding the selected subvector of vec.

Function: %vector-reverse-copy vec start past
Macro: vector-reverse-copy V

Like %vector-copy, but copy the elements in the reverse order from the selected subvector of vec.

(vector-reverse-copy (view '#(5 4 3 2 1 0)
                       (start 1)
                       (past  5)))
⇒ #(1 2 3 4)
Function: %vector-copy! dst-vec dst-start src-vec src-start src-past
Macro: vector-copy! dst-V src-V

Write the selected source subvector into the selected destination subvector. This function supports copying over the same vector.

The selected destination subvector starts at dst-start in dst-vec and may extend until the end of the vector. In the destination vector view dst-V: If a past index is specified, it is ignored.

Function: %vector-reverse-copy! dst-vec dst-start src-vec src-start src-past
Macro: vector-reverse-copy! V-dst V-src

Like %vector-copy!, but this copies the elements in the reverse order. This function supports copying over the same vector.

Function: %vector-take nitems vec start past
Function: %vector-take-right nitems vec start past
Macro: vector-take V nitems
Macro: vector-take-right V nitems

Return the first or last nitems of the selected subvector. These functions always return a newly allocated vector.

Function: %vector-drop nitems vec start past
Function: %vector-drop-right nitems vec start past
Macro: vector-drop V nitems
Macro: vector-drop-right V nitems

Drop the first or last nitems of the selected subvector and return the resulting vector. These functions always return a newly allocated vector.


Next: , Previous: , Up: vectors   [Index]