[plt-scheme] plai: lazyness and exercise 6.4.2

From: Thomas Holubar (scheme at phirho.com)
Date: Wed Aug 26 17:20:12 EDT 2009

Hi Emre!

emre berat nebioğlu wrote:
 > May be i am wrong. But i read this discussion and i plan to finish 
PLAI book. I am in chapter 12.
 > I supposed the different between eager and lazy regime is in 
application of interp function.

Well, the difference is illustrated in chapter 3.4 (page 23).
The first evaluation scheme is eager, the second lazy.

 > I mean for eager regime we make two recursive call.
 >
 > (interp blah
 >  blah blah
 >  (interp blah....
 >
 > for lazy regime, we make one recursive call
 > (interp blah
 >  blah blah  blah...))
 > am i true ?

Since 'interp' could be anything I do not think it qualifies well as a 
definition for eager vs. lazy.
If applying 'interp' to an expression has the effect of "reducing" it 
(simplifying it as much as possible) - instead of delaying reduction - 
then it works eagerly.
So in some cases the patterns you describe coincide with eager <-> lazy, 
but IMHO they're certainly not a definition.

Regards,
Thomas


Posted on the users mailing list.