On Feb 21, 2012, at 6:24 PM, Don Blaheta wrote: > As an alternative, when I was teaching from HtDP last year I used the > pattern > > (define (list-blah lst) > (cond [(empty? lst) ...] > [(cons? lst) (cons-blah lst)])) > > (define (cons-blah lst) > (combiner (blah (first lst)) > (list-blah (rest lst))))
Yes, I've done that too. In fact, the "lists" chapter of _Picturing Programs_ introduces the two-function version and then discusses "collapsing" it into one function. What I've said in class is "if the two-function version makes more sense to you, do it that way. If the one-function version makes more sense to you, do it that way." Although for some data structures (e.g. n-ary trees) you NEED multiple functions. Stephen Bloch sbl...@adelphi.edu ____________________ Racket Users list: http://lists.racket-lang.org/users