[ZPT] fill-slot only works in immediately enclosing use-macro?

Evan Simpson evan@zope.com
Mon, 03 Dec 2001 16:49:35 -0500


Brad Clements wrote:

> This seems a little ugly and still requires a bit of work on the user's standpoint.


Quite so :-(

> Would it be possible to keep a "stack" of fill-slots that are "pending" as use-macro's are 
> traversed. When a define-slot is encountered, the "bottom most" fill-slot that matches 
> the name is used to fill it, if any.


Possible? Yes.  There's an issue of unknown significance here, though, 
related to the "slot signature" of a macro.  I would rather enforce some 
extra work in order to let you figure out which slots a macro supplies by 
examining the definition of the macro.  If slots were implicitly passed 
along, then there would be no way to do this without recursively examining 
all of the macros used by a macro.  This might not even be statically 
possible, if one of the used macros were dynamically generated (think 
ZFormulator for ZPT).

Cheers,


Evan @ Zope