[racket] Why internal definitions?

From: Jordan Schatz (jordan at noionlabs.com)
Date: Tue Nov 15 23:50:42 EST 2011

>From Racket v5.2 release notes:

> Internal-definition expansion has changed to use let* semantics for
> sequences that contain no back references. This change removes a
> performance penalty for using internal definitions instead of let in
> common cases, and it only changes the meaning of programs that capture
> continuations in internal definitions. Internal definitions are now
> considered preferable in style to let.

I'm not sure that I understand, but if I have it figured out then this:

(define (foo x)
  (local [(define i 10)
          (define j 12)]
         (+ x i j)))

Is now considered better style then this?

(define (foo2 x)
  (let ([i 10]
        [j 12])
    (+ x i j)))

Why?

Shalom,
Jordan


Posted on the users mailing list.