[racket] why do I get undefined , when using internal definition?

From: Grant Rettke (grettke at acm.org)
Date: Sun Jul 10 10:53:16 EDT 2011

On Sun, Jul 10, 2011 at 1:49 AM, Eli Barzilay <eli at barzilay.org> wrote:
> `define' is defining a potentially recursive value, so that
>
>  (define (loop) (loop))
>
> works as you expect.  In simple terms, you can think about an internal
> define as something that expands to a `letrec'.  So what you wrote is
> basically the same as
>
>  (define (make-color color)
>    (letrec ([color color])
>      ...))

In what kind of situations would you use internal define over letrec?



Posted on the users mailing list.