Re: [racket-users] Expression context

2015-09-16 Thread Leif Andersen
Oh cool, I didn't know that existed. Thanks for sharing. ~Leif Andersen On Tue, Sep 15, 2015 at 12:37 AM, Jens Axel Søgaard wrote: > FWIW an alternative to (let () ...) is block. > > http://docs.racket-lang.org/reference/block.html?q=block > > 2015-09-15 0:16 GMT+02:00 John Carmack : > >> Is t

Re: [racket-users] Expression context

2015-09-14 Thread Jens Axel Søgaard
FWIW an alternative to (let () ...) is block. http://docs.racket-lang.org/reference/block.html?q=block 2015-09-15 0:16 GMT+02:00 John Carmack : > Is there a deep reason why defines aren’t allowed in the branches of an > if, but are for cond / while / unless? > > > > Wrapping code in (let() …) in

Re: [racket-users] Expression context

2015-09-14 Thread Leif Andersen
> Wrapping code in (let() …) instead of (begin …) works fine, but it is a strange quirk to explain to someone else. This is because begin actually does not create new scope in racket, where as (let () ...) does. Consider the following code: #lang racket (define (f x) (begin (define g 5))

Re: [racket-users] Expression context

2015-09-14 Thread Matthias Felleisen
On Sep 14, 2015, at 6:16 PM, John Carmack wrote: > Is there a deep reason why defines aren’t allowed in the branches of an if, > but are for cond / while / unless? > > Wrapping code in (let() …) instead of (begin …) works fine, but it is a > strange quirk to explain to someone else. It exp

[racket-users] Expression context

2015-09-14 Thread John Carmack
Is there a deep reason why defines aren't allowed in the branches of an if, but are for cond / while / unless? Wrapping code in (let() ...) instead of (begin ...) works fine, but it is a strange quirk to explain to someone else. -- You received this message because you are subscribed to the Go