[racket] to local or not to local

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Mon Jan 3 11:48:49 EST 2011

FWIW, there have been some (somewhat) recent changes to the way
internal definitions work that make them behave much better. In
particular, if you have a bunch of internal definitions with
expressions interspersed, then they all go in the same (recursive)
scope.

Robby

On Mon, Jan 3, 2011 at 10:33 AM, Matthias Felleisen
<matthias at ccs.neu.edu> wrote:
>
> On Jan 3, 2011, at 11:31 AM, Stefan Schmiedl wrote:
>
>> Hi.
>>
>> In the web-server related documentation, I see the preferred way to
>> create local procedures as
>>
>>  (define (start request)
>>    (local ((define (response-generator...))
>>            (define (some-handler...)))
>>      (do-something-with-these)))
>>
>> Another way to create local procedures is
>>
>>  (define (start request)
>>    (define (response-generator...))
>>    (define (some-handler...))
>>    (do-something-with-these)))
>>
>> Is there some (subtle?) difference between these approaches?
>> Which way is appropriate in what conditions?
>
>
> There is. An experienced programmer (*) should go with the second form.
>
> (*) someone who can handle error messages and subtle changes to them.
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users
>


Posted on the users mailing list.