[racket-dev] Internal definitions in `define'

From: Neil Toronto (neil.toronto at gmail.com)
Date: Fri Dec 30 12:24:14 EST 2011

Now that I'm a whiny junior dev, does that mean I can do the +/-1 thing? 
Because after reading Eli's argument - particularly the symmetry 
arguments - I'm totally +1-ing his proposal.

This is one of the last places I find myself using the (let () ...) 
idiom. (The others are `define-syntax-rule', `syntax-rules' and 
`syntax-case', but I don't think those should change.)

Neil T

On 12/30/2011 01:36 AM, Eli Barzilay wrote:
> I was against it for similar reasons, but the question is whether
> there's a technical point that makes it a bad choice.
> As for making errors: I changed my mind when I though about the
> symmetry argument -- using the same argument, I'd expect to do the
> exact same kind of mistakes with functions, but I don't think that
> I've ever had one.  Another factor is that if you think about possible
> mistakes, then I take it as a point in favor of doing this, since it
> reduces the number o ff parens as well as getting rid of the familiar
> (define foo (let () ...stuff...)) thing which should result in less
> mistakes.
> 8 hours ago, Robby Findler wrote:
>> I'm mildly against it, since it seems too easy to make parenthesis
>> errors that are very confusing (ie if you move a paren from the end
>> of one define to the end of a following define, the errors will get
>> strange).
>> Robby
>> On Thu, Dec 29, 2011 at 1:08 PM, Eli Barzilay<eli at barzilay.org>  wrote:
>>> Does anyone know of a reason to not have an implicit `begin' in a
>>> plain definition, translated into an implicit (let () ...) in racket?
>>> When I see things like this:
>>>   http://stackoverflow.com/questions/8667403
>>> I think that people expect the syntax of `define' to be uniform, so if
>>> you can switch these:
>>>   (define (foo x) (+ x 1))
>>>   (define foo (+ 8 1))
>>> then the expectation is for the same to work when there are multiple
>>> expressions.
>>> --
>>>           ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
>>>                     http://barzilay.org/                   Maze is Life!
>>> _________________________
>>>   Racket Developers list:
>>>   http://lists.racket-lang.org/dev

Posted on the dev mailing list.