vector-map -- r7rs Definition functor;
vector-map (from vonuvoli);Procedure variants:
((map-procedure vector |1...|) -> (vector))
map-procedure;vector;... -- at least one time;vector;scheme:base -- (scheme base);scheme -- (scheme);(vector-map proc vector_1 vector_2 ...)Domain: It is an error if
procdoes not accept as many arguments as there arevectors and return a single value.The
vector-mapprocedure appliesprocelement-wise to the elements of thevectors and returns a vector of the results, in order. If more than onevectoris given and not all vectors have the same length,vector-mapterminates when the shortest vector runs out. The dynamic order in whichprocis applied to the elements of thevectors is unspecified. If multiple returns occur fromvector-map, the values returned by earlier returns are not mutated.(vector-map cadr '#((a b) (d e) (g h))) ===> #(b e h) (vector-map (lambda (n) (expt n n)) '#(1 2 3 4 5)) ===> #(1 4 27 256 3125) (vector-map + '#(1 2 3) '#(4 5 6 7)) ===> #(5 7 9) (let ((count 0)) (vector-map (lambda (ignored) (set! count (+ count 1)) count) '#(a b))) ===> #(1 2) or #(2 1)
The text herein was sourced and adapted as described in the "R7RS attribution of various text snippets" appendix.