vector-for-each -- r7rs Definition functor;
vector-for-each (from vonuvoli);Procedure variants:
((for-each-procedure vector |1...|) -> (undefined))
for-each-procedure;vector;... -- at least one time;undefined;scheme:base -- (scheme base);scheme -- (scheme);(vector-for-each proc vector_1 vector_2 ...)Domain: It is an error if
procdoes not accept as many arguments as there arevectors.The arguments to
vector-for-eachare like the arguments tovector-map, butvector-for-eachcallsprocfor its side effects rather than for its values. Unlikevector-map,vector-for-eachis guaranteed to callprocon the elements of thevectors in order from the first element(s) to the last, and the value returned byvector-for-eachis unspecified. If more than onevectoris given and not all vectors have the same length,vector-for-eachterminates when the shortest vector runs out. It is an error forprocto mutate any of the vectors.(let ((v (make-list 5))) (vector-for-each (lambda (i) (list-set! v i (* i i))) '#(0 1 2 3 4)) v) ===> (0 1 4 9 16)
The text herein was sourced and adapted as described in the "R7RS attribution of various text snippets" appendix.