[Zope3-dev] Re: New METAL extension feature

shane at hathawaymix.org shane at hathawaymix.org
Mon Nov 22 14:38:31 EST 2004



On Mon, 22 Nov 2004, Tonico Strasser wrote:

> A suggestion: to avoid confusion about why metal:define-macro works different 
> when used together with metal:use-macro I would call it metal:extend-macro or 
> similar.
>
> <html metal:extend-macro="context/@@coolskin_macros/page">

I thought about adding to the language, but I didn't want to incur the 
wrath of ZPT users by suggesting a new attribute.  Besides, you really 
need to state both the source of the macro being extended and the name of 
the macro being defined.  You can infer the name from the last part of the 
path, but TAL is nice and explicit now and I don't want to muck it up.

You're on target, though.  The implementation compiles macro extensions 
using a new bytecode called "extendMacro".

This really doesn't change define-macro.  When there is a use-macro and 
define-macro in the same tag, the use-macro defines the behavior of the 
tag, while define-macro, as always, has no effect on the output of the 
template.

Shane


More information about the Zope3-dev mailing list