[ZPT] Slots in nested macro definitions

dieter.maurer@haufe.de dieter.maurer@haufe.de
Mon, 17 Dec 2001 10:15:59 +0100


I have a macro with the following nested structure:

 define-macro="OuterMacro"
   ...
   define-macro="NestedMacro"
     ...
     define-slot="Slot"
     ...
   /define-macro
 /define-macro

Of course, the reference point for the slot definition is ambiguous:
is it a slot of "NestedMacro" or of "OuterMacro" or both.

Earlier ZPT versions treated it as a slot for all enclosing macros.
I used that quite heavily although I have been aware of the
ambiguity.

Newer versions, especially the current CVS version, treats it
as a splot definition for the immediate enclosing macro
only. That's bad for me:

  I need a way to fill the slot by 'use-macro="OuterMacro"'.

But, I fear, there is currently no way to influence the body
of "NestedMacro" by users of the outer macro.

  Hopefully, I am wrong...

If not, we should think about defining such a way, probably along
to following lines:

  Currently, a "define-macro" defines a macro *AND* uses
  this macro immediately.

  We should either have a way to

    *  define the macro only (and not automatically use it)

    *  provide the same customization for the "define-macro"
       (with its implicit "use-macro") we have for "use-macro".
       Especially, allow its slots to be filled by the surrounding
       context.


Dieter