vectorforeach  loop over the elements of a vector
LIBRARY
(import (rnrs)) ;R6RS
(import (rnrs base)) ;R6RS
(import (scheme base)) ;R7RS
SYNOPSIS
(vectorforeach proc vector1 vector2 ...)
DESCRIPTION
Applies
proc
elementwise to
the elements of the
vectors
for its side effects, in order from the first elements to the last.
 R6RS

The procedure
proc
is always called in the same dynamic environment as
vectorforeach
itself.
The implementation must check the restrictions on
proc
to the extent performed by applying it as described. An implementation
may check whether
proc
is an appropriate argument before applying it.
 R7RS

If more than one vector is given and not all vectors have the same
length,
vectorforeach
terminates when the shortest vector runs out.
RETURN VALUES
 R6RS

Returns unspecified values.
 R7RS

Returns an unspecified value.
EXAMPLES
(vectorforeach
display
'#("Hello, " "world" ".0))
; prints: Hello, world.
RATIONALE
R7RS says that this procedure and a few others were added in order to
round out the sequence operations.
COMPATIBILITY
The R7RS variant of this procedure terminates early if the vectors are
not the same length, but the R6RS variant requires that all the
vectors are the same length. Additionally R7RS makes it an error to
mutate any of the vectors.
ERRORS
This procedure can raise exceptions with the following condition types:
 &assertion (R6RS)

The wrong number of arguments was passed or an argument was outside its domain.
In particular, the
vectors
should all have the same length and
proc
should accept as many arguments are there are vectors.
 R7RS

The assertions described above (except for the length requirement) are errors.
Implementations may signal an error, extend the procedure's
domain of definition to include such arguments,
or fail catastrophically.
It is an error for
proc
to mutate any of the vectors.
SEE ALSO
foreach(3scm),
vectormap(3scm)
STANDARDS
R6RS,
R7RS
HISTORY
This procedure first appeared in R6RS. It was later also added to R7RS.
AUTHORS
This page is part of the
schememanpages
project.
It includes materials from the RnRS documents.
More information can be found at
https://github.com/schemedoc/manpages/
.
Markup created by unroff 1.0sc, March 04, 2023.