You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Slava Zimine <sl...@japgod.mine.nu> on 2002/04/01 01:15:21 UTC

silent notation for variables

Hi, 

looking from scarab  templates i saw  referencing velocity variables:

1. $!foo

2. !$foo


1. in the vtl-reference-guide.html 
   $!foo is said to be silent notation.

 What is the special meaning of this? 


2. !$foo  ,  does it mean that $foo is referenced to a java object of
type Boolean  and $!foo  means just a (false) state of this object ? 


cheers, 

slava





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


Re: silent notation for variables

Posted by Slava Zimine <sl...@japgod.mine.nu>.
Thanx, Geir,  as usual. 
 I'd think it's worth adding the explanation of silent notation in VTL
reference or Developper's quide. 

Hapyy Easter. 

slava


On Mon, 2002-04-01 at 02:20, Geir Magnusson Jr. wrote:
> On 3/31/02 6:15 PM, "Slava Zimine" <sl...@japgod.mine.nu> wrote:
> 
> > Hi, 
> > 
> > looking from scarab  templates i saw  referencing velocity variables:
> > 
> > 1. $!foo
> > 
> 
> This is the 'silent notation'
> 
> > 2. !$foo
> 
> This is boolean negation - 'not $foo'
>  
> > 
> > 1. in the vtl-reference-guide.html
> >  $!foo is said to be silent notation.
> > 
> > What is the special meaning of this?
> > 
> 
> It means that if 'foo' isn't found in the context, nothing is written to the
> output stream.
> 
> Compare that to the non-silent notation
> 
>   $foo
> 
> Which will output '$foo' to the output if 'foo' is not found in the context.
>  
> > 2. !$foo  ,  does it mean that $foo is referenced to a java object of
> > type Boolean  and $!foo  means just a (false) state of this object ?
> > 
> 
> For !$foo -> if $foo is boolean true, !$foo is false...
> 
> -- 
> Geir Magnusson Jr.                                     geirm@optonline.net
> System and Software Consulting
> "He who throws mud only loses ground." - Fat Albert
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 



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


Re: silent notation for variables

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 3/31/02 6:15 PM, "Slava Zimine" <sl...@japgod.mine.nu> wrote:

> Hi, 
> 
> looking from scarab  templates i saw  referencing velocity variables:
> 
> 1. $!foo
> 

This is the 'silent notation'

> 2. !$foo

This is boolean negation - 'not $foo'
 
> 
> 1. in the vtl-reference-guide.html
>  $!foo is said to be silent notation.
> 
> What is the special meaning of this?
> 

It means that if 'foo' isn't found in the context, nothing is written to the
output stream.

Compare that to the non-silent notation

  $foo

Which will output '$foo' to the output if 'foo' is not found in the context.
 
> 2. !$foo  ,  does it mean that $foo is referenced to a java object of
> type Boolean  and $!foo  means just a (false) state of this object ?
> 

For !$foo -> if $foo is boolean true, !$foo is false...

-- 
Geir Magnusson Jr.                                     geirm@optonline.net
System and Software Consulting
"He who throws mud only loses ground." - Fat Albert


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