- apply PROCEDURE ARGUMENT ... VALUES-LISTprocedure
A very restricted variant of the standard apply procedure. PROCEDURE is called with the given arguments and VALUES-LIST, which must be the single "rest" argument of a user defined procedure. The following code will return a vector of two elements, the first being the integer 123, the second being the result of the procedure foo:
(call-with-values foo (lambda vals (apply vector 123 vals)))Since CRUNCH does not support either lists or multiple values, the last argument to apply always ever holds a single value. This particular use of apply is only implemented to support the common idiom where all results of an expression are saved and returned unchanged, which is often used in macros:
(define-syntax begin0 (syntax-rules () ((_ e0 e1 ...) (call-with-values (lambda () e0) (lambda var (begin e1 ... (apply values var)))))))