Jose Alberto Fernandez wrote:
> 
> > From: Geir Magnusson Jr. [mailto:[EMAIL PROTECTED]]
> >
> >
> > There are a few issues pending that we should talk about.  Some came
> > from watching turbine list, some from discussion (thanks, Fedor).
> >
> > 1) What do we do about determining if a reference is null in VTL?
> >
> > Currently, we can use #if(), but that's misleading - if the
> > reference is
> > in the context, is a boolean, and is false, than we get the
> > same result
> > as if the thing wasn't in there.  So thats no good.  So we need
> > something that is clear about what it does, and what the result means.
> >
> > Some suggestions :
> >
> >  - use something like : #if( $foo == null )
> >    I like this one, but Fedor noted we might want to keep
> >    the concept of null out of things, although I think it
> >    is a keyword in javascript, so it isn't that foreign.
> >
> >  - or #ifdefined( $foo )  or #ifdef( $foo )
> >     This is trivially easy to do.
> >
> >  - or another operator :   #if( ?$foo )
> >
> 
> I like $?foo which play well with $!foo.
> What I would suggest is having $?foo returned a boolean value
> depending on whether $foo is defined or not.
> 
> The advantage of this is that one could use such a construct in
> other than if:
> 
>   #set($a = $?foo)
> 
> sets $a to true or false depending on whether foo is defined or not.
> Still #if( $?foo ) works fine as we are just evaluating a boolean
> expression.
> 
> >
> > 2)  Should we allow the following aliases for the logicals :
> >
> >    logical AND : '&&' (current), '&', 'AND', 'and'
> >
> >    logical OR : '||' (current), '|', 'OR', 'or'
> >
> >    equality : '==' (current), '=', 'eq' ?
> >
> > Since there is little or no chance of offering bitwise operations in
> > VTL, this might remove some confusion with designers (if
> > there is any).
> 
> -1, I do not like providing multiple ways of saying the same thing
> just for the sake of providing it. It usually backfires sooner or later.

Yeah, it's been canned.  Thought I should bring it up as it came up, for
completeness...

> Is there any problen with people using the current operators?
> The more alternatives the more people get confuse beacuse they think the
> different versions mean different things in ways they do not know.
> Some times is true [e.g., #if($foo) vs. #if($?foo) ] and some times it does
> not like above. It is better to only have the former.
> 
> Jose Alberto
> 

-- 
Geir Magnusson Jr.                               [EMAIL PROTECTED]
Velocity : it's not just a good idea. It should be the law.
http://jakarta.apache.org/velocity

Reply via email to