[racket] internal define in define

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Wed Sep 21 22:24:47 EDT 2011

Yes, that is Racket style these days (as codified in the style guide).
Saving the level(s) of indention is great, as far as I'm concerned.

As to the original question, tho, it seems like you can usually just
put the nested defines next to the original define and unless you have
a very big function you're not gaining a whole lot of useful scope
protection. And I worry about the possibility of going from a bad
error message to just strange behavior when you mis-parenthesize
something.

Did anyone check and see if there are any uses of (define <x> (let ()
...)) in the tree or on planet?

Robby

2011/9/21 Greg Hendershott <greghendershott at gmail.com>:
> Is this "let over lambda", instead as "define over lambda"?
>
> Actually in general, is the intent that define should be an
> alternative to let in all cases?  Although you pay 2X typing the
> symbol itself, you save parens and a level of indent? :)
>
> On Wed, Sep 21, 2011 at 4:24 AM, David Van Horn <dvanhorn at ccs.neu.edu> wrote:
>> The grammar for define includes
>>
>>   (define id expr)
>>
>> but I wonder if this couldn't be relaxed to
>>
>>   (define id body)
>>
>> so that you could write things like
>>
>>   (define count
>>     (define i 0)
>>     (λ () (begin0 i (set! i (add1 i)))))
>>
>> David
>> _________________________________________________
>>  For list-related administrative tasks:
>>  http://lists.racket-lang.org/listinfo/users
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users



Posted on the users mailing list.