Re: [racket-dev] Racket docs and data-driven design

2011-09-17 Thread Bloch Stephen
On Sep 16, 2011, at 11:52 AM, Shriram Krishnamurthi wrote: I introduced templates today. Almost as if on cue, one student asked whether he could use else instead of (cons? l). I told them I was going to make a MORAL judgment about why it was EVIL, and spent ten minutes talking about all that

Re: [racket-dev] Racket docs and data-driven design

2011-09-16 Thread Matthias Felleisen
I admit sloppiness. On Sep 16, 2011, at 12:49 PM, Shriram Krishnamurthi wrote: > In addition to what Jay said, when the datatype evolves, it's harder > for someone reading the code to tell whether the "else" was meant to > cover only one other case (and now there's two, and someone forgot to >

Re: [racket-dev] Racket docs and data-driven design

2011-09-16 Thread Shriram Krishnamurthi
In addition to what Jay said, when the datatype evolves, it's harder for someone reading the code to tell whether the "else" was meant to cover only one other case (and now there's two, and someone forgot to update the function) or truly all the other cases. When you have crisp predicates, I see n

Re: [racket-dev] Racket docs and data-driven design

2011-09-16 Thread Jay McCarthy
I don't like it either because it makes the function a contract violator: (define (listy l) (cond [(empty? l) ...] [else ... (first l) ...])) (define (f x) ... (listy 5) ...) f breaks listy's contract, but it goes undetected in most of Racket and all of HtDP and listy gets blamed for

Re: [racket-dev] Racket docs and data-driven design

2011-09-16 Thread Robby Findler
Why is else evil? I can see how it might be pragmatic to avoid it in a language without contracts, but I'm having trouble seeing evil. Robby On Fri, Sep 16, 2011 at 10:52 AM, Shriram Krishnamurthi wrote: > I introduced templates today.  Almost as if on cue, one student asked > whether he could

Re: [racket-dev] Racket docs and data-driven design

2011-09-16 Thread Sam Tobin-Hochstadt
The same is true of HtDP: http://htdp.org/2003-09-26/Book/curriculum-Z-H-13.html#node_chap_9 and HtDP 2e: http://www.ccs.neu.edu/home/matthias/HtDP2e/htdp2e-part2.html . (search for "[else" in a similar way). On Fri, Sep 16, 2011 at 11:52 AM, Shriram Krishnamurthi wrote: > I introduced templates

[racket-dev] Racket docs and data-driven design

2011-09-16 Thread Shriram Krishnamurthi
I introduced templates today. Almost as if on cue, one student asked whether he could use else instead of (cons? l). I told them I was going to make a MORAL judgment about why it was EVIL, and spent ten minutes talking about all that. As class ended, one of my students came up and said, "So wh