Hi Claude,

I originally proposed to allow the bang character in the
#set( $!bar = $!foo ) directive to:
a) avoid logging the null from $!foo (this is current behaviour
    when rendering foo)
b) allowing setting the context to null with then bang in $!bar
I sent a patch many years ago (was rejected, event though it is BC).

See the threads at:
  "how to set null value"
  http://mail-archives.apache.org/mod_mbox/velocity-user/200505.mbox/[EMAIL 
PROTECTED]

  "Quiet reference in set"
  http://mail-archives.apache.org/mod_mbox/velocity-user/200102.mbox/[EMAIL 
PROTECTED]
  http://mail-archives.apache.org/mod_mbox/velocity-user/200103.mbox/[EMAIL 
PROTECTED]

  [PATCH] ASTSetDirective to handle a bang
  http://mail-archives.apache.org/mod_mbox/velocity-dev/200101.mbox/[EMAIL 
PROTECTED]

  "wish list" (you participated in this thread!)
  http://mail-archives.apache.org/mod_mbox/velocity-dev/200310.mbox/[EMAIL 
PROTECTED]

more embedded:

Claude Brisson wrote:
> Hi dev,
> 
> I'd like to change the behaviour of #set($foo = $evaluates_to_null)
> 
> The current behaviour is to log (debug loglevel) the message "RHS of
> #set statement is null...".
> 
> What I'd like to do:
> 
>  - set the loglevel of this message to warn

+0

> 
>  - don't log anything if the left reference is quiet, as in
>       #set($!foo = $evaluates_to_null)
>    (this syntax is already allowed but does nothing special)

I proposed here to not log when the bang is on the RHS, conform to the current 
notation:
  #set( $foo = $!null )

Using a bang in the LHS, should allow setting the context variable to null:
  #set( $!foo = $null )## this may or may not put a warning in the log

> 
> This will allow template coders
>  - to anticipate whether an assignment can be null

+1

>  - to be warned if another assignment is null for a warn loglevel
> 
> 
> Any objection?
> 
> 
>   Claude
> 

:) Christoph


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

Reply via email to