[plt-scheme] swindle: (define (values a b) (values 1 2))

From: Eli Barzilay (eli at barzilay.org)
Date: Wed Sep 14 16:12:26 EDT 2005

On Sep 12, jos koot wrote:
> (define (values a b) (begin (void) (old-values (+ a 100) (+ b 100)))) ; 
> assigns new values to a and b
> BUT:
> (define (values a b) (void) (old-values (+ a 1000) (+ b 1000))) ; redefines 
> proc values

This is confusing, I should fix it (sometimes...).

> I dont like this. I think (define (values <ident> ...) <expr1>
> <expr> ...)  should always define/assign to var values (unless
> syntax define has been redefined). I think another syntactic form
> should be choosen for (define (values a b) (values 1 2)) if it is to
> define/assign vars a and b (e.g: define-values)

This form was an experiment with another way to define multiple
bindings.  It may be confusing -- but only the top-level is a problem,
since in a module context you cannot redefine `values' anyway.
(Judging by the `(define a (+ a 1000))', you seem to be attached to
the top-level behavior...)

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

Posted on the users mailing list.