[racket] Why internal definitions?

From: Jim Wise (jwise at draga.com)
Date: Thu Nov 17 09:16:59 EST 2011

> An *internal* definition differs slightly from a local definition
> in syntax and *semantics*: 
> (define (foo x)
>   (define i 10)
>   (define j 12)
>   (+ i j x))
> It's preferable to local defines for aesthetic reasons because it 
> consumes less horizontal space (a smaller indentation). 

On the other hand, the ~corresponding let form shows very clearly the
scope of the newly-bound identifiers (and most editors make it very easy
to highlight the whole let form in one swoop), which I've found useful
in explaining lexical scope.

But you've taught a heck of a lot more people to scheme than I have...

				Jim Wise
				jwise at draga.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 831 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20111117/6ce99077/attachment.sig>

Posted on the users mailing list.