I was reading Matthew Flatt's slides [1] and tried out an example using #lang lazy that IIUC should run "forever":<br><br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>#lang lazy<br>
<br>(define (list-from n)<br> (cons n (list-from (add1 n))))<br><br>(define (has-negative? l)<br> (or (negative? (car l))<br> (has-negative? (rest l))))<br><br>(has-negative? (list-from 0))<br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
<br><br>However, after a minute or so it gives an out of memory error.<br>DrRacket is set to use up to 256 MB, and even if I raise the limit to 512 MB, eventually I get:<br><br>"The evaluation thread is no longer running, so no evaluation can take place until the next execution.<br>
The program ran out of memory."<br><br>Is it expected to happen? Why?<br><br><br><br>Thanks,<br><br clear="all">Rodolfo Carvalho<br><br><br>[1] <a href="http://www.eng.utah.edu/~cs6510/space.pdf">http://www.eng.utah.edu/~cs6510/space.pdf</a><br>