[plt-scheme] find-method/who

From: Doug Orleans (dougo at place.org)
Date: Sat Mar 26 22:15:12 EST 2005

Matthew Flatt writes:
 > Suppose that the free-var use involved a couple of modules, A and B,
 > where A defines a macro, and B uses the macro in a sub-expression sent
 > to free-vars. Usually, A and B will be loaded with the same privilege,
 > so the free-vars macro will expose the free variables introduced by A.
 > But if someone loads B with less privilege than A, and if the free-vars
 > expansion ignores uncertifiable identifiers, then the expansion of B
 > will be different than before. In short, I doubt that you want to be in
 > the position where the meaning of a module (i.e., it's expansion)
 > depends on its privilege relative to other modules.
 > For whatever real problem you're trying to solve, I imagine that you'll
 > have to say that the system only works when all code has the same
 > privilege.

Well, I already need to use a module that I don't have privilege over,
namely MzLib's "class.ss".  It seems like I should not be reporting
`find-method/who' as a free variable of every procedure that uses the
`send' macro, because it's private to "class.ss".  On the other hand,
what I'm actually doing with the free variables (using their values
for online partial evaluation) is more like a program processor that
happens to be implemented with the help of macros (for creating
procedures that allow access to their free variables).  Although now
that I think about it, it might have made more sense to go the
errortrace route and use `current-compile' to annotate all procedures
with their free variables...  Hmm.

--dougo at place.org

Posted on the users mailing list.