Re: [racket-dev] `cond' / `when' / `unless' / etc bodies

2010-10-12 Thread Jos Koot
We already have begin-with-definitions. Would there be a great penalty to simply wrap every body-like sequence of expressions and definitions with begin-with-definitions? The latter even allows more freedom than (let () def ... expr ...), for it allows (begin-with-definitions def-or-expr ...). I

Re: [racket-dev] `cond' / `when' / `unless' / etc bodies

2010-10-12 Thread Eli Barzilay
An hour ago, Matthew Flatt wrote: At Mon, 11 Oct 2010 20:38:58 -0400, Eli Barzilay wrote: At Mon, 11 Oct 2010 19:15:09 -0400, Eli Barzilay wrote: I'd love to see an implicit `#%begin', which could have the above apply in more places automatically. (It was one of the feature

Re: [racket-dev] `cond' / `when' / `unless' / etc bodies

2010-10-12 Thread Eli Barzilay
Three minutes ago, Matthew Flatt wrote: At Tue, 12 Oct 2010 10:43:03 -0400, Eli Barzilay wrote: An hour ago, Matthew Flatt wrote: At Mon, 11 Oct 2010 20:38:58 -0400, Eli Barzilay wrote: At Mon, 11 Oct 2010 19:15:09 -0400, Eli Barzilay wrote: I'd love to see an implicit `#%begin',

Re: [racket-dev] `cond' / `when' / `unless' / etc bodies

2010-10-12 Thread Matthew Flatt
At Tue, 12 Oct 2010 11:16:35 -0400, Eli Barzilay wrote: Three minutes ago, Matthew Flatt wrote: At Tue, 12 Oct 2010 10:43:03 -0400, Eli Barzilay wrote: An hour ago, Matthew Flatt wrote: At Mon, 11 Oct 2010 20:38:58 -0400, Eli Barzilay wrote: At Mon, 11 Oct 2010 19:15:09 -0400, Eli

Re: [racket-dev] `cond' / `when' / `unless' / etc bodies

2010-10-11 Thread Joe Marshall
On Mon, Oct 11, 2010 at 9:59 AM, Neil Toronto neil.toro...@gmail.com wrote: If I get a vote, +1/2 from me. My vote isn't +1 because I'd rather see a syntactic restriction removed: make the inside of a `begin' an internal definition context. Then the change would happen in every similar macro

Re: [racket-dev] `cond' / `when' / `unless' / etc bodies

2010-10-11 Thread Carl Eastlund
On Mon, Oct 11, 2010 at 2:10 PM, Joe Marshall jmarsh...@alum.mit.edu wrote: On Mon, Oct 11, 2010 at 9:59 AM, Neil Toronto neil.toro...@gmail.com wrote: If I get a vote, +1/2 from me. My vote isn't +1 because I'd rather see a syntactic restriction removed: make the inside of a `begin' an

Re: [racket-dev] `cond' / `when' / `unless' / etc bodies

2010-10-11 Thread Eli Barzilay
Yesterday, Robby Findler wrote: Maybe you're saying that people would be confused by that error? Woudln't that already happen with (define (foo x) (define x (add1 x)) x) ? Yes, they would. I just think that overall more newbies fall for the trap of trying a conditional definition, so

Re: [racket-dev] `cond' / `when' / `unless' / etc bodies

2010-10-11 Thread Eli Barzilay
40 minutes ago, Matthew Flatt wrote: I agree about changing `when', `unless', and `cond'. I can't see changing `begin', especially now that internal-definition contexts allow a mixture of definitions and expressions. Unlike changing `when' and `unless', changing `begin' could change some

[racket-dev] `cond' / `when' / `unless' / etc bodies

2010-10-10 Thread Eli Barzilay
I like mixing definitions and expressions -- maybe the bodies of `cond' etc should also allow it? The only downside I see is the possible confusion in somthing like (define (foo x) (when (even? x) (define x (add1 x)) (printf increment\n)) x) ;; why isn't this working? but that seems

Re: [racket-dev] `cond' / `when' / `unless' / etc bodies

2010-10-10 Thread Jens Axel Søgaard
2010/10/10 Eli Barzilay e...@barzilay.org: I like mixing definitions and expressions -- maybe the bodies of `cond' etc should also allow it? In  (define (foo x)    (when (even? x) (define x (add1 x)) (printf increment\n))    x) is the scope of the definition (define x ...) the entire body

Re: [racket-dev] `cond' / `when' / `unless' / etc bodies

2010-10-10 Thread Matthias Felleisen
On Oct 10, 2010, at 2:43 PM, Robby Findler wrote: I too am in favor of when, unless, and cond being definition contexts. +1. I routinely wrap cond/when in let () for just that purpose. _ For list-related administrative tasks: