[plt-scheme] named let versus letrec

From: Noel Welsh (noelwelsh at gmail.com)
Date: Mon Feb 4 08:04:12 EST 2008

I think you've basically said them all.  I prefer named let, and
increasingly, internal define.  What I used to write as

(define (foo ...)
  (let ([bar ...] ...)
    body))

I'm now more likely to write as

(define (foo ...)
  (define bar ...)
  body)

N.

On Feb 3, 2008 10:56 PM, Grant Rettke <grettke at acm.org> wrote:
> If you plan to define a recursive function that you will call
> immediately, you can use either `letrec` or a `named let`.
>
> The `letrec` approach is more explicit in that you are defining a
> function and then explicitly calling it, whereas the `named let` is
> shorter, and does the same thing.
>
> When it comes to Lisp style, what are the pros and cons of both?
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>


Posted on the users mailing list.