[racket] One define to rule them all

From: Eli Barzilay (eli at barzilay.org)
Date: Sat Nov 13 13:23:04 EST 2010

Two minutes ago, Robby Findler wrote:
> On Sat, Nov 13, 2010 at 12:08 PM, Eli Barzilay <eli at barzilay.org> wrote:
> > Three hours ago, Matthias Felleisen wrote:
> >>
> >> On Nov 12, 2010, at 9:21 PM, Eli Barzilay wrote:
> >>
> >> > In swindle, all of these do the "obvious" things:
> >> >
> >> >  (define (values a b) (values 1 2))
> >>
> >> I am sure glad Swindle can define binary tightly recursive
> >> functions.  Does it implement TR properly so that this really
> >> runs as an infinite loop?
> >
> > I can't parse that.
> 
> Nice to see that swindle also allows redefinition of built-in
> functions.

It does, but not in the above where `values' plays a keyword that
makes it expand to (define-values (a b) (values 1 2)).

If you want to define your own values, you need to avoid that form,
which can be done with (define value (lambda ...)).  This is in
contrast to Neil's macro which doesn't have the function definition
sugar.

(Either way, it's all questionable, IMO.)

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


Posted on the users mailing list.