Re: [racket] Space safety in lazy

2012-02-19 Thread Rodolfo Carvalho
Thanks, Matthew. On Sun, Feb 19, 2012 at 11:50, Matthew Flatt wrote: > Oops --- I should have tried that program more carefully. > > The problem seems to be with `or'. If I change to `if', then the > example runs as intended: > > (define (has-negative? l) > (if (negative? (car l)) > #t

Re: [racket] Space safety in lazy

2012-02-19 Thread Matthew Flatt
Oops --- I should have tried that program more carefully. The problem seems to be with `or'. If I change to `if', then the example runs as intended: (define (has-negative? l) (if (negative? (car l)) #t (has-negative? (rest l The `or' from `lazy' effectively adds a `!' aroun

[racket] Space safety in lazy

2012-02-18 Thread Rodolfo Carvalho
I was reading Matthew Flatt's slides [1] and tried out an example using #lang lazy that IIUC should run "forever": ;;; #lang lazy (define (list-from n) (cons n (list-from (add1 n (define (has-negative? l) (or (negati