chickadee » scheme » call-with-values

call-with-values producer consumerprocedure

Calls its producer argument with no values and a continuation that, when passed some values, calls the consumer procedure with those values as arguments. The continuation for the call to consumer is the continuation of the call to call-with-values.

(call-with-values (lambda () (values 4 5))
                  (lambda (a b) b))
                                                           ===>  5

(call-with-values * -)                                     ===>  -1