Nathan, Nathan Bubna wrote:
I'm pretty sure #local is still just in Geir's whiteboard section. No one has ever gotten it promoted out of there. I've never been opposed to it, but i've also never been interested in putting the work needed into it (tests, docs, etc).
I have to admit that when I started really writing macros (other than super simple ones), I was disappointed to learn that there was no "stack"... that is, I couldn't implement certain things properly using the macro facility because recursive calls would overwrite variables from what I would have considered "outer" scopes.
If anyone is contemplating a "Velocity 2.x", I would seriously recommend that macros and other things (like #parse, #evaluate, and similar things) run in their own, local and inherited contexts. This gives much greater freedom to the developer, who doesn't have to worry about "temporary" variables within macros, etc. clobbering variables set in the caller's scope.
It would be best if this were simply a language feature, instead of a hack provided through another directive (though it would have to be hacked in this way for Velocity 1.x, since some folks may actually rely on this inconvenient setup.
-chris
signature.asc
Description: OpenPGP digital signature