velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leos Literak <>
Subject scope of introduced variables
Date Mon, 04 Mar 2002 10:46:32 GMT

I'd like to know, if you are planning any changes
of scope of variables introduced in template.

I've got following problems:

($b=='str', $c=null)


result: str str

I have to be careful about variable names.
I shall not use them again, because they
are not zeroed, when setting to null variable.

I'd prefer to unset variable, if right side
is null. If for any reason you don't want this,
please create #unset

2\ velocimacro

#macro (showArticle $relation $last)






When $diz or $dizs are initialized for first time, $diz is always
used in following invocations, until they are reset by new value.
The result is of course wrong.

Yes, I know, there is configuration key for macros local scope.
But I can't use it, because few of my macros forwards data to next
macro in chain:

#macro(first $b)
$b.OtherData: #second($c)

and when I set local scope to true, such macros stopped working.

Again, it could be fixed with explicit #unset, but I'd prefer
to have new tag for local scope variables.
Something like

#macro(my $a)
$a, $count

What do you think? I'm tired of making workarounds and hacks to these
limitations. I think, Velocity is really great product and I like it.
But sometimes it is too simple :-(

I will try to watch this thread over HTTP, if I found web interface
to this archive. If you want to ensure, I will see your comments,
cc my email, 'cause I'm not in this conference.


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

View raw message