www.delorie.com/gnu/docs/guile/guile_460.html   search  
Buy GNU books!

Guile Reference Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

39.10 SRFI-11 - let-values

This module implements the binding forms for multiple values let-values and let-values*. These forms are similar to let and let* (see section 25.2 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))

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.

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003