[plt-scheme] A question on "expand"

From: Robert Bruce Findler (robby at cs.uchicago.edu)
Date: Thu Nov 14 10:14:05 EST 2002

At Wed, 13 Nov 2002 23:28:52 -0500, Eli Barzilay wrote:
> 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
> info.)

I don't fully understand when it doesn't work either, but I would say
that probably the most useful point for such debugging is precisely for
understanding the most complex parts of the system.

> > 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.)

I think that the expand-n and fixing the original problem have the same
problem, the result has information in it that isn't in a syntax
object.

> > 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.

I could have done that, actually. But, we've tried very hard to make
the evaluation of one expression not affect the compilation of future
expressions (a mis-feature by any measure) so it probably doesn't
matter much.

> > 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.

I'll try to see if I can trim some space.

Robby


Posted on the users mailing list.