Right, that's what I thought. This is only different in that: (define v (delay (+ 1 2))) (sum v) ; => v
Which means clients of `sum` now have to handle either Integers or Promises. Is that intentional? On Sat, Jul 7, 2012 at 10:23 AM, Matthias Felleisen <matth...@ccs.neu.edu> wrote: > > I may have made a mistake under time pressure: > > [else (+ (force (sum (car x))) (force (sum (cdr x))))] > > > > > > On Jul 7, 2012, at 10:19 AM, Sam Tobin-Hochstadt wrote: > >> On Sat, Jul 7, 2012 at 10:14 AM, Matthias Felleisen >> <matth...@ccs.neu.edu> wrote: >> >>> p.s. Sam's version forces too early because strict functions should >>> force not variable lookups. This is a common misconception among >>> programmers. >>> I suspect it goes back to Abelson and Sussman getting it wrong (see what >>> happens if you don't understand the foundations). >> >> I still don't think my version forces too early -- your alternative >> contains no calls to `force` at all. Are you suggesting that I should >> `force` around the recursive calls to `sum`? In that case, clients >> are exposed to promises, and the result type is (U Integer (Promise >> Integer)). I can't tell from your description if you think that's an >> acceptable result. >> -- >> sam th >> sa...@ccs.neu.edu > -- sam th sa...@ccs.neu.edu _________________________ Racket Developers list: http://lists.racket-lang.org/dev