for-each

[procedure] for-each proc list1 list2 ...

R5RS: The arguments to for-each are like the arguments to map, but for-each calls proc for its side effects rather than for its values. Unlike map, for-each is guaranteed to call proc on the elements of the lists in order from the first element(s) to the last, and the value returned by for-each is unspecified.

SRFI-1 extends R5RS to allow the arguments to be of unequal length; it terminates when the shortest list runs out.

R6RS: The implementation should check the lists have the same length. It is a recommendation.

See also map, pair-for-each.

[generic] for-each proc coll1 coll2 ...

Gauche extends this to take arbitrary collections (with gauche.collection module).