[ZPT] Some Macros Questions/Suggestions

Dieter Maurer dieter@handshake.de
Tue, 5 Mar 2002 21:57:23 +0100


Evan Simpson writes:
 > ...
 > [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.
By defining them explicitly in the "define-macro" something like:

   [macro]
   <XXX metal:define-macro="macro-name"
        metal:define-arguments="arg1 default-value;
	                        arg2 default-value;
				..."
   >

   [use]
   <YYY metal:use-macro="...."
        metal:with-arguments="argi value;
	                      argj value;
			      ...
			      "
   >

The effect would be as if the arguements were "tal:define"d at the top
of the macro (before a potential "tal:define" explicitely there).


Dieter