velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <>
Subject Re: #set silently fails if RHS is null
Date Thu, 08 Nov 2001 19:15:05 GMT
On 11/8/01 1:53 PM, "Sean Legassick" <> wrote:

> In message <>, Geir Magnusson Jr.
> <> writes
>> If no one really objects, I can add this as a default-off switch to allow,
>> when turned on, a null value on the RHS to remove the reference from the
>> context, so things will behave as you expect.
> I personally don't like the idea of using a configuration parameter to
> determine language semantics. It seems a potential cause of nasty
> hard-to-track bugs when moving templates from one site to another for
> example.
> Is there actually any reasonable use of the non-removing semantics? That
> is, does anyone really write templates that take advantage of a #set
> failing where the RHS is null? If not why not just change the behaviour
> so at least it keeps VTL semantically consistent for a given release of
> Velocity.

The problem is that this is a 180 degree switch, so it won't do to just
throw it in there.  By adding a switch, we can play with it and see if it
really solves problems, and it prevents things from going haywire for people
if they get a new nightly or something for a bugfix.

I say 'play with it' because the problem can easily be worked around via a
tool, but that makes for funny templates.

One solution is adding an event handler to let the programmer make the


Geir Magnusson Jr.                           
System and Software Consulting
"They that can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety." - Benjamin Franklin

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

View raw message