Well, fine with me. That's why I was asking. I will make sure that it is
right in the User Guide.

        Best regards
                Henning


On Sun, 2006-08-27 at 13:36 -0700, Nathan Bubna wrote:
> Gotta say, i'm -1 on this too.  zero isn't nothing to me. :)  i could
> easily see this wreaking havoc on some of my templates.
> 
> On 8/27/06, Henning P. Schmiedehausen <[EMAIL PROTECTED]> wrote:
> > Just stumbled over that:
> >
> > --- cut ---
> >
> > #set ($a = 0)
> > #set ($b = 1)
> >
> > #set ($c = $a and $b)
> > #set ($d = $a or $b)
> >
> > A: $a
> > B: $b
> > C: $c
> > D: $d
> >
> > Rendering this template gives a bit of a surprising result:
> >
> > A: 0
> > B: 1
> > C: true
> > D: true
> >
> > While the behaviour is obvious (anything not-null is true in Velocity
> > expressions), it is still sort of a "gotcha". Personally I'd like to
> > see this behaviour changed (number '0' or the empty String '' get
> > converted to "false") because then it would match the expression
> > system of well known languages like perl or php(?).
> >
> > Any opinions on that?
> >
> >         Best regards
> >                 Henning
> >
> > --
> > Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
> > [EMAIL PROTECTED]        +49 9131 50 654 0   http://www.intermeta.de/
> >
> > RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for hire
> >    Linux, Java, perl, Solaris -- Consulting, Training, Development
> >
> > Social behaviour: Bavarians can be extremely egalitarian and folksy.
> >                                     -- http://en.wikipedia.org/wiki/Bavaria
> > Most Franconians do not like to be called Bavarians.
> >                                     -- 
> > http://en.wikipedia.org/wiki/Franconia
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
[EMAIL PROTECTED]        +49 9131 50 654 0   http://www.intermeta.de/

      RedHat Certified Engineer -- Jakarta Turbine Development
   Linux, Java, perl, Solaris -- Consulting, Training, Engineering

"For a successful technology, reality must take precedence over
 public relations for Nature cannot be fooled" - Richard P. Feynman


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

Reply via email to