Next: SRFI-43 Predicates, Up: SRFI-43 [Contents][Index]
Create and return a vector of size size, optionally filling it with fill. The default value of fill is unspecified.
(make-vector 5 3) ⇒ #(3 3 3 3 3)
Create and return a vector whose elements are x ....
(vector 0 1 2 3 4) ⇒ #(0 1 2 3 4)
The fundamental vector constructor. Create a vector whose length is length and iterates across each index k from 0 up to length - 1, applying f at each iteration to the current index and current seeds, in that order, to receive n + 1 values: the element to put in the kth slot of the new vector, and n new seeds for the next iteration. It is an error for the number of seeds to vary between iterations.
(vector-unfold (lambda (i x) (values x (- x 1))) 10 0) ⇒ #(0 -1 -2 -3 -4 -5 -6 -7 -8 -9) (vector-unfold values 10) ⇒ #(0 1 2 3 4 5 6 7 8 9)
Like vector-unfold
, but it uses f to generate elements from
right-to-left, rather than left-to-right.
(vector-unfold-right (lambda (i x) (values x (+ x 1))) 10 0) ⇒ #(9 8 7 6 5 4 3 2 1 0)
Allocate a new vector whose length is end - start and fills
it with elements from vec, taking elements from vec starting
at index start and stopping at index end. start
defaults to 0 and end defaults to the value of
(vector-length vec)
. If end extends beyond the length of
vec, the slots in the new vector that obviously cannot be filled
by elements from vec are filled with fill, whose default
value is unspecified.
(vector-copy '#(a b c d e f g h i)) ⇒ #(a b c d e f g h i) (vector-copy '#(a b c d e f g h i) 6) ⇒ #(g h i) (vector-copy '#(a b c d e f g h i) 3 6) ⇒ #(d e f) (vector-copy '#(a b c d e f g h i) 6 12 'x) ⇒ #(g h i x x x)
Like vector-copy
, but it copies the elements in the reverse order
from vec.
(vector-reverse-copy '#(5 4 3 2 1 0) 1 5) ⇒ #(1 2 3 4)
Return a newly allocated vector that contains all elements in order from the subsequent locations in vec ....
(vector-append '#(a) '#(b c d)) ⇒ #(a b c d)
Append each vector in list-of-vectors. Equivalent to
(apply vector-append list-of-vectors)
.
(vector-concatenate '(#(a b) #(c d))) ⇒ #(a b c d)
Next: SRFI-43 Predicates, Up: SRFI-43 [Contents][Index]