[plt-scheme] multiple values question

From: Eli Barzilay (eli at barzilay.org)
Date: Wed Jun 17 22:48:18 EDT 2009

On Jun 17, Hugh Myers wrote:
> Hi all,
> Given a function that returns a list:
> (define (f) (list 1 2 3))
> How do I marry it up to (define!-values (a b c) ?

(define-values (a b c) (apply values (f)))

or just make `f' return three values.

> p.s. CL has a 'Multiple-value-setq which provides pretty much what I
> need, but that is CL, not scheme...


          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

Posted on the users mailing list.