On this page:
top
up

10.1Multiple ValuesπŸ”— i

See Multiple Return Values for general information about multiple result values. In addition to call-with-values (described in this section), the let-values , let*-values , letrec-values , and define-values forms (among others) create continuations that receive multiple values.

procedure

(values v...)any

v:any/c
Returns the given vs. That is, values returns its provided arguments.

Examples:
> (values 1)

1

> (values 123)

1

2

3

> (values )

procedure

(call-with-values generatorreceiver)any

generator:(-> any )
receiver:procedure?
Calls generator, and passes the values that generator produces as arguments to receiver. Thus, call-with-values creates a continuation that accepts any number of values that receiver can accept. The receiver procedure is called in tail position with respect to the call-with-values call.

Examples:

3

> (call-with-values (lambda ()1)(lambda (xy)(+ xy)))

arity mismatch;

the expected number of arguments does not match the given

number

expected: 2

given: 1

top
up

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /