Search

( vector-copy! [ vector? to ] [ integer? at ] [ vector? from ] ) ( vector-copy! [ vector? to ] [ integer? at ] [ vector? from ] [ integer? start ] ) ( vector-copy! [ vector? to ] [ integer? at ] [ vector? from ] [ integer? start ] [ integer? end ] )
It is an error if at is less than zero or greater than the length of to. It is also an error if (- (vector-length to) at) is less than (- end start). Copies the elements of vector from between start and end to vector to, starting at at. The order in which elements are copied is unspecified, except that if the source and destination overlap, copying takes place as if the source is first copied into a temporary vector and then into the destination. This can be achieved without allocating storage by making sure to copy in the correct direction in such circumstances
( vector-for-each [ procedure? proc ] [ vector? vector1 ] [ vector? vector2 ] ... )
proc ( λ obj ... )
It is an error if proc does not accept as many arguments as there are vectors. The arguments to vector-for-each are like the arguments to vector-map, but vector-for-each calls proc for its side effects rather than for its values. Unlike vector-map, vector-for-each is guaranteed to call proc on the elements of the vector s in order from the first element(s) to the last, and the value returned by vector-for-each is unspecified. If more than one vector is given and not all vectors have the same length, vector-for-each terminates when the shortest vector runs out. It is an error for proc to mutate any of the vectors.
( vector-map [ procedure? proc ] [ vector? vector1 ] [ vector? vector2 ] ... ) vector?
proc ( λ obj ... ) *
It is an error if proc does not accept as many arguments as there are vectors and return a single value. The vector-map procedure applies proc element-wise to the elements of the vector s and returns a vector of the results, in order. If more than one vector is given and not all vectors have the same length, vector-map terminates when the shortest vector runs out. The dynamic order in which proc is applied to the elements of the vector s is unspecified. If multiple returns occur from vector-map, the values returned by earlier returns are not mutated.
( vector-ref [ vector? vector ] [ integer? k ] ) *
It is an error if k is not a valid index of vector. The vector-ref procedure returns the contents of element k of vector.
( vector-set! [ vector? vector ] [ integer? k ] obj )
It is an error if k is not a valid index of vector. The vector-set! procedure stores obj in element k of vector.
( when test expression1 expression2 ... )
The test is evaluated, and if it evaluates to a true value, the expressions are evaluated in order. The result of the when expression is unspecified.
( with-exception-handler [ procedure? handler ] [ procedure? thunk ] ) *
handler ( λ obj ) *
thunk ( λ ) *
It is an error if handler does not accept one argument. It is also an error if thunk does not accept zero arguments. The with-exception-handler procedure returns the results of invoking thunk. Handler is installed as the current exception handler in the dynamic environment used for the invocation of thunk.
( with-input-from-file [ string? string ] [ procedure? thunk ] ) *
thunk ( λ ) *
with-input-from-file, with-output-to-file The file is opened for input or output as if by open-input-file or open-output-file, and the new port is made to be the value returned by current-input-port or current-output-port (as used by (read), (write obj ), and so forth). The thunk is then called with no arguments. When the thunk returns, the port is closed and the previous default is restored. It is an error if thunk does not accept zero arguments. Both procedures return the values yielded by thunk . If an escape procedure is used to escape from the continuation of these procedures, they behave exactly as if the current input or output port had been bound dynamically with parameterize.
( with-output-to-file [ string? string ] [ procedure? thunk ] ) *
thunk ( λ ) *
with-input-from-file, with-output-to-file The file is opened for input or output as if by open-input-file or open-output-file, and the new port is made to be the value returned by current-input-port or current-output-port (as used by (read), (write obj ), and so forth). The thunk is then called with no arguments. When the thunk returns, the port is closed and the previous default is restored. It is an error if thunk does not accept zero arguments. Both procedures return the values yielded by thunk . If an escape procedure is used to escape from the continuation of these procedures, they behave exactly as if the current input or output port had been bound dynamically with parameterize.
( write obj ) ( write obj [ output-port? port ] )
Writes a representation of obj to the given textual output port. Strings that appear in the written representation are enclosed in quotation marks, and within those strings backslash and quotation mark characters are escaped by backslashes. Symbols that contain non-ASCII characters are escaped with vertical lines. Character objects are written using the #\ notation. If obj contains cycles which would cause an infinite loop using the normal written representation, then at least the objects that form part of the cycle must be represented using datum labels as described in section 2.4. Datum labels must not be used if there are no cycles. Implementations may support extended syntax to represent record types or other types that do not have datum representations.
( write-char [ char? char ] ) ( write-char [ char? char ] [ output-port? port ] )
Writes the character char (not an external representation of the character) to the given textual output port and returns an unspecified value.
( write-shared obj ) ( write-shared obj [ output-port? port ] )
The write-shared procedure is the same as write, except that shared structure must be represented using datum labels for all pairs and vectors that appear more than once in the output.
( write-simple obj ) ( write-simple obj [ output-port? port ] )
The write-simple procedure is the same as write, except that shared structure is never represented using datum labels. This can cause write-simple not to terminate if obj contains circular structure.