[plt-scheme] A question on "expand"

From: Eli Barzilay (eli at barzilay.org)
Date: Wed Nov 13 23:28:52 EST 2002

On Nov 13, Robert Bruce Findler wrote:
> I have some bad news for you Eli: iterating expand-once isn't the
> same as expand, so building a debugging tool like that can easily
> mislead people.

Yeah, I know.  But my impression was that most of the time it works
fine, unless you're doing some advanced stuff which means that you
should know the problems anyway...  (Well that's as much as I can
understand from the comment on expand-once which doesn't give more

> I made a vague suggestion to Matthew about how to fix this problem
> and he may be able to turn that into an actual solution at some
> point.

Is there some simple example of the difference you get?  How would a
solution look like?  Maybe something like expand-n that just reworks
its way from the original every time (it's a debugging tool, so there
shouldn't be any runtime problems).  Or maybe something more
sophisticated.  (Similar to conversions in Nuprl: you can apply them
at some specific address, repeat them N times etc etc.)

> More generally, we recognize the need for a macro PDE and we're
> planning to do something about it. I've just put in some very basic
> stuff into DrScheme as a prototype. You may have noticed the
> "Expander" language in the language dialog. Instead of running the
> program, it expands the program and produces the expanded code.

I actually expected it to evaluate normally but have the exapnded code
of every expression too -- but that's probably more than a language.

> Also, DrScheme now does a good job of printing out syntax objects
> (it can do better, but it is much better than it used to be).

Yes -- that's definitely good to have.  BTW, are the empty lines
needed?  They make the expansion box be very big.

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

Posted on the users mailing list.