[ZPT] METAL: attributes as slots

Dieter Maurer dieter@handshake.de
Tue, 16 Oct 2001 10:17:34 +0200 (CEST)


Chris Withers writes:
 > Dieter Maurer wrote:
 > > 
 > > I feel, it would be good, if the definitions of the "use-macro"
 > > were effectively appended to the definition list of the
 > > "define-macro". This way, the "use" could override and
 > > extend the definitions provided by the macro definition.
 > 
 > Ah, I see where you're coming from.
 > 
 > So, rather than _replace_ the whole tag, use-macro and fill-slot would, in
 > effect, do a set union of the attributes with the ones in the use/fill part
 > taking precedence over the ones in the define part?
Something like that.

We need however get sound semantics for this parameter passing.
I am no longer confident that my original proposal (appending
the definitions on the "use-macro" onto the end of the "define-macro"'s
"tal:define") is the right solution.

I think now, we should not introduce magic but instead strive
for clarity.

I now favor explicit "metal:define-parameters" and
"metal:use-parameters" similar to XSLT,
i.e. the "metal:define-parameters" in "define-macro" gets default values
that can be overridden by "metal:use-parameters" in the "use-macro".

As usual for parameter passing for languages with nested
namespaces, the parameters form a namespace by itself containing
the namespace of the macro body.

 > This sounds excellent, how do we make it happen?
We may need more discussions:

  Do we need positional and keyword parameters?
  Do we need the equivalent of Python's "*args" or "**kw"?


Dieter