You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Jon Scott Stevens <jo...@latchkey.com> on 2002/02/14 20:51:22 UTC

Re: cvs commit: jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node ASTNotNode.java

on 2/14/02 11:40 AM, "geirm@apache.org" <ge...@apache.org> wrote:

> geirm       02/02/14 11:40:00
> 
> Modified:    src/java/org/apache/velocity/runtime/parser/node
>                       ASTNotNode.java
> Log:
> Fix for bug reported by Chris Rousseau <Ch...@timerasolutions.com>
> 
> where
> 
>   #set($foo = !$bar )
> 
> wouldn't work.  I don't think there was ever a reson for not letting
> it be the logical compliment...

Ok, I have a question here:

What if $bar resolves to null? What is the ! of null? Heck, what is the
result of !$bar even if $bar returns a non null? Is it a Boolean?

I think that this syntax is rather confusing and very Perl'ish.

-jon


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: cvs commit: jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node ASTNotNode.java

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 2/14/02 2:51 PM, "Jon Scott Stevens" <jo...@latchkey.com> wrote:

> on 2/14/02 11:40 AM, "geirm@apache.org" <ge...@apache.org> wrote:
> 
>> geirm       02/02/14 11:40:00
>> 
>> Modified:    src/java/org/apache/velocity/runtime/parser/node
>>                       ASTNotNode.java
>> Log:
>> Fix for bug reported by Chris Rousseau <Ch...@timerasolutions.com>
>> 
>> where
>> 
>>   #set($foo = !$bar )
>> 
>> wouldn't work.  I don't think there was ever a reson for not letting
>> it be the logical compliment...
> 
> Ok, I have a question here:
> 
> What if $bar resolves to null? What is the ! of null? Heck, what is the
> result of !$bar even if $bar returns a non null? Is it a Boolean?

A null is 'false' in VTL.  I donĀ¹t really like it, but we should be
consistent.
 
> I think that this syntax is rather confusing and very Perl'ish.

You bet.  

-- 
Geir Magnusson Jr.                                     geirm@optonline.net
System and Software Consulting
"Now what do we do?"


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>