This module implements the binding forms for multiple values
let-values
and let*-values
. These forms are similar to
let
and let*
(see Local Variable Bindings), but they support
binding of the values returned by multiple-valued expressions.
Write (use-modules (srfi srfi-11))
to make the bindings
available.
(let-values (((x y) (values 1 2)) ((z f) (values 3 4))) (+ x y z f)) ⇒ 10
let-values
performs all bindings simultaneously, which means that
no expression in the binding clauses may refer to variables bound in the
same clause list. let*-values
, on the other hand, performs the
bindings sequentially, just like let*
does for single-valued
expressions.