[ZPT] Some Macros Questions/Suggestions

Evan Simpson evan@zope.com
Tue, 05 Mar 2002 11:41:31 -0500


Chris Withers wrote:
>>Simplicity of implementation, and nobody has really worked out in detail
>>how all the metal statements should really interact on the same tag.
> 
> Where and how would be good to kick off a discussion about this?

Here would be fine.

> [macro]
> <a href="foo" metal:define-attribute="href one">Foo!</a>
> 
> [Use Macro]
> <a href="bar" metal:fill-attribute="one string:notbar">Bar!</a>

This can be readily accomplished with:

[macro]
<a href="foo" tal:attributes="href one | default">Foo!</a>

[Use Macro]
<... tal:define="one string:notbar">
   ...
   <... metal:use-macro ...>
   ...

As Dieter has pointed out, this implicit parameterization of macros, 
while fully consistent, is rather messy and implicit.  I'm not sure how 
it could helpfully be made more explicit, though.

Cheers,

Evan @ Zope