
Next: Control Flow
Up: Scheme Language Modifications
Previous: Strings
- (build-vector n f)
creates a vector with n elements. The elements are initialized
by calling f on each element index. The elements will be
initialized in order from 0 to n-1.
- (tabulate n f) is
equivalent to (build-vector n f).
- (foreach! v f) applies
f to each element of the vector v and sets the same
vector element to the result. The f procedure is called
with two arguments: the original vector element and the position
of the element in the vector.
- (2vector l) creates a two
dimensional vector from a list of lists l.
- (2make-vector m n)
creates an m x n matrix, initialized with #<void>.
- (2vector-init m n f)
creates an m x n matrix, initialized by calling
f with the indicies of each matrix element.
- (2vector-ref t i j)
extracts the (i, j) component from the matrix t.
- (2vector-set! t i
j v) sets the (i, j) component from the
matrix t to v.
- (2foreach! t f) applies
f to each element of the matrix t and sets the same
matrix element to the result. The f procedure is called
with three arguments: the original matrix element and the position
indicies of the element in the matrix.
- (2vector-print t vprint)
prints the matrix t by calling vprint on each column of
the matrix. Each column is passed to vprint as a vector.
PLT