I have several Velocity macros:
#macro(Alpha) #set($p = 1) #@Beta() $p
And I use them like this:
#set($p = 0)
I believe it looks like this (ignore formatting): 2, 2, 2
But I would like to have the correct closing behavior, including more locally restricted names hiding the names of the parent areas. In particular, the use of $ p labeled '3' should refer to the value 0, '2' to the value 2, and '1' to the value 1.
Given the correct closing semantics, it will print: 2, 1, 0
Is there a way to get this, or a way to implement a custom directive / modification of the behavior of the #macro directive for this?
gzak source share