I opened a Jira issue on this:
  http://issues.apache.org/jira/browse/VELOCITY-540

:) Christoph

Nathan Bubna wrote:
> On 4/24/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>> this example brings up the issue of making #local(...) a
>> core directive:
> 
> i'm always forgetting that #local is out there.  do we have a JIRA
> issue open about putting this in the core?  even if we couldn't reach
> consensus there (and with the #springBind issue, i'm sure we're
> getting closer to that), then it would be a good reminder and a place
> to keep discussion centralized.
> 
>> > #macro( truncate $stringVariable $length )
>> #local( $truncateMe )
>> > #set( $truncateMe = "$!stringVariable" )
>> > #if( $truncateMe.length() <=
>> > $length)$truncateMe#else$!{truncateMe.substring(0,$length)}...#end##
>> #end
>> > #end
>>
>> I prefer #local vs velocimacro.context.localscope because
>> you can create macro libraries that allow declaring local vars
>> without polluting the namespace, but also enables setting global
>> variables. See the thread ending on 16.04.2007 "RE:
>> velocimacro.context.localscope"
>> with the #springBind example for such a case.
>>
>> :) Chirstoph
>>
[snip]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to