velocity-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Byron Foster (JIRA)" <>
Subject [jira] Commented: (VELOCITY-680) RFC: New #local directive that behaves like #set but puts things into local context in macro rendering
Date Wed, 18 Feb 2009 20:40:01 GMT


Byron Foster commented on VELOCITY-680:

Yea, I've leaned away from the independent #local and #global directives (and #setlocal, #setglobal),
and I do like allot the ability to set something at the #parse level scope.  Funny  Claude
brought up the #set($ = bar), "control" objects as Nathan puts it, I'v been
brewing over the same approach for this stuff.  #set($ = bar) is elegant I think,
and it is a trivial implementation.  In fact $global could be done now by a user out of the
box.  This also has a clean path to namespaces if we go down that road.

I like it, If there aren't any objections I'll pull the #local and #global changes.

> RFC: New #local directive that behaves like #set but puts things into local context in
macro rendering
> ------------------------------------------------------------------------------------------------------
>                 Key: VELOCITY-680
>                 URL:
>             Project: Velocity
>          Issue Type: New Feature
>    Affects Versions: 1.7
>            Reporter: Jarkko Viinamäki
>         Attachments: velocity-local-directive-1.1.patch, velocity-local-directive.patch
> It would be very useful to be able to set variables that are in local macro scope. That
is, they do not overwrite "global" variables and are thrown away after macro rendering. This
would allow people to build macro libraries that do not clash so easily with each other.
> There is some implementation of a "LocalDirective" in experimental/localdirective but
I didn't quite get it and it doesn't follow the same syntax as #set. I used a few minutes
to hack together this alternative implementation which behaves exactly like #set but it puts
things in local context only.
> There's only one test case since this is Request-for-Comments type of patch.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message