You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Colm McCartan <co...@owl.co.uk> on 2001/12/13 15:46:24 UTC

Clarification: booleans in context

Hello all,

 From the Users Guide:

> The variable $foo is evaluated to determine whether it is
>       true, which will happen under one of two circumstances: (i)
>       $foo is a boolean (true/false) which has a true value, or
>       (ii) the value is not null.



Can I just clarify this: in case (i) are we talking about a boolean 
primitive only (as opposed to a wrapper Boolean) that can be pushed into 
the context?

What if the decision is based on an object method that returns a 
(wrapper) Boolean - as long as it is non-null it will evaluate as true, yes?

Thanks
colm




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


Re: Clarification: booleans in context

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 12/13/01 9:46 AM, "Colm McCartan" <co...@owl.co.uk> wrote:

> Hello all,
> 
> From the Users Guide:
> 
>> The variable $foo is evaluated to determine whether it is
>>       true, which will happen under one of two circumstances: (i)
>>       $foo is a boolean (true/false) which has a true value, or
>>       (ii) the value is not null.
> 
> 
> 
> Can I just clarify this: in case (i) are we talking about a boolean
> primitive only (as opposed to a wrapper Boolean) that can be pushed into
> the context?

Everything in the context is an Object, so it would be Boolean.TRUE or
Boolean.FALSE

> 
> What if the decision is based on an object method that returns a
> (wrapper) Boolean - as long as it is non-null it will evaluate as true, yes?

No - if that Boolean was Boolean.FALSE, it would eval to false...



-- 
Geir Magnusson Jr.                       geirm@optonline.net
System and Software Consulting
You're going to end up getting pissed at your software
anyway, so you might as well not pay for it. Try Open Source.



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