[plt-scheme] minor glitch in Lazy Scheme?

From: Prabhakar Ragde (plragde at uwaterloo.ca)
Date: Sat Jan 13 12:16:18 EST 2007

Eli Barzilay wrote:

> I'm not sure what the problem is.  I did this:
> * Started DrScheme, switched to Lazy Scheme
> * Hit f1
> * enter "readline"
> * click on any of the four results
> No surprises -- all work as expected.  I suspect that you're doing
> something different though.

Well, now I can't recreate it. Now I get the four results, but I didn't 
last night; I just got the suggestion to save "results.ss". I did it 
twice, with the same results, before I noticed I was in Lazy Scheme. 
Maybe I had hit something else in between by accident. If it happens 
again (which is unlikely), I'll try to investigate more.

> Like Matthias said -- that was exactly the point.  I wanted to teach
> lazy evaluation, and the choices were (a) switch to Haskell, (b) use
> lazy streams.  (a) is too strong of a change to make any sense --
> switching the syntax makes everything too confusing, having it
> statically typed doesn't help too.  (b) is the traditional solution,
> but I find it too weak when you want to demonstrate laziness properly.

I'd appreciate any pedagogical examples of lazy evaluation for which 
streams are too weak -- I think I am just using standard examples 
(Fibonacci, sieve of Eratosthenes, Hamming numbers) for which they'd 
work fine. I was planning to briefly discuss delay and force (this would 
be in a single optional lecture, not something for credit or testable). --PR

Posted on the users mailing list.