[plt-scheme] Debugging the lazy language

From: Eli Barzilay (eli at barzilay.org)
Date: Sun Dec 30 18:37:20 EST 2007

On Dec 30, Noel Welsh wrote:
> Final question of the evening...
> I'm experimenting with the lazy language.  Now I've written some
> code that works fine w/ eager evaluation.  I converted to lazy,
> mostly just by changing module declarations to (lib "lazy.ss"
> "lazy"), and now the code doesn't do anything.  I've peppered force
> ("!") statements around but still no joy.  It uses the class system
> if that makes any difference.

It does.  The problem is that you want to use lazy code only, and if
you require a module that does its own functions (even a simple macro
that expands to its own `lambda' rather than lazy's `lambda') then
things won't work fine.  (It looks like the best solution for this
would be to forbid requiring any strict syntax into a lazy module.)

> Is there any way I can debug program in the lazy language and work
> out what is and isn't getting evaluated (and better yet, why)?  I
> sprinkled a few printfs around and so far, no output.

You should also wrap the `printf's in `!'s.  It will change in the
near future to do that for all toplevel or module-toplevel expressions
that are not definitions.

> Also, if there any better documentation than the terse doc.txt?

Not really.  Most of it is trivial -- just like in Scheme, just lazy.
The things that do need some documentation (desperately) are the
various forces, how to make strict and lazy code communicate, and the
special forms (side effects and related).

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

Posted on the users mailing list.