You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Travis Low <tr...@dawnstar.org> on 2000/09/05 05:59:05 UTC

dollar sign

To simplify the syntax further, would it be possible to make the "$" optional
within velocity statements?

#if( foo )
  blah
#end

But it would still be required for things like:

<p>$foo</p>

-- Travis Low  
   <ma...@dawnstar.org>
   <http://dawnstar.org/travis>

Re: dollar sign

Posted by Jason van Zyl <jv...@periapt.com>.
On Fri, 8 Sep 2000, Stefan Mainz wrote:

> Jason van Zyl wrote:
> > 
> > On Fri, 8 Sep 2000, Stefan Mainz wrote:
> > 
> > > Travis Low wrote:
> > > >
> > > > Jon Stevens wrote:
> > > > >
> > > > > I don't get what you are saying? Are you saying make the syntax optional? If
> > > > > so, I would be against that as well. I want to have as little optional
> > > > > syntax as possible. It makes things more concrete that way.
> > > >
> > > > Yes, I did say "optional".  I understand and agree that there should be as
> > > > little optional syntax as possible.  But this would make templates much more
> > > > readable, therefore more usable.  A small cost for a relatively large benefit.
> > >
> > >
> > > what does
> > >
> > > #if( true )
> > > //
> > > #else
> > > //
> > > #end
> > >
> > > evaluate to?
> > >
> > 
> > This syntax is not available yet. When
> > it is, it will evalute to:
> > 
> > //
> 
> How do you know i did mean

#if (true)

is always true. 

#if (false)

is always false.

Just the words themselves behave like booleans.
 
> #if( "true" ) or
> #if( $true ) if you allow to omit the leading $ in if statements.

#if (true) is different then #if ($true).

> I guess we substitute true with ok in this example.

yes.

> > We would like to include this with Velocity,
> > but the WebMacro syntax comes first. That's
> > what I'm working on. Bob is working on
> > the new syntax.
> 
> I hope so, because we have tons of templates with webmacro syntax.

The WebMacro syntax will be fully supported.

jvz.

-- 

Jason van Zyl
jvanzyl@periapt.com


Re: dollar sign

Posted by Stefan Mainz <St...@Dynaware.de>.
Jason van Zyl wrote:
> 
> On Fri, 8 Sep 2000, Stefan Mainz wrote:
> 
> > Travis Low wrote:
> > >
> > > Jon Stevens wrote:
> > > >
> > > > I don't get what you are saying? Are you saying make the syntax optional? If
> > > > so, I would be against that as well. I want to have as little optional
> > > > syntax as possible. It makes things more concrete that way.
> > >
> > > Yes, I did say "optional".  I understand and agree that there should be as
> > > little optional syntax as possible.  But this would make templates much more
> > > readable, therefore more usable.  A small cost for a relatively large benefit.
> >
> >
> > what does
> >
> > #if( true )
> > //
> > #else
> > //
> > #end
> >
> > evaluate to?
> >
> 
> This syntax is not available yet. When
> it is, it will evalute to:
> 
> //

How do you know i did mean

#if( "true" ) or
#if( $true ) if you allow to omit the leading $ in if statements.
I guess we substitute true with ok in this example.

> We would like to include this with Velocity,
> but the WebMacro syntax comes first. That's
> what I'm working on. Bob is working on
> the new syntax.

I hope so, because we have tons of templates with webmacro syntax.

Stefan
-- 
Dynaware Systemberatung GmbH                 Tel: +49 89
743130-15                 
Am Westpark 7                                Fax: +49 89
743130-05            
81373 Müchnen                                mobil: +49 171
6920761               
http://www.dynaware.de                      
mailto:Stefan.Mainz@Dynaware.de

Re: dollar sign

Posted by Jason van Zyl <jv...@periapt.com>.
On Fri, 8 Sep 2000, Stefan Mainz wrote:

> Travis Low wrote:
> > 
> > Jon Stevens wrote:
> > >
> > > I don't get what you are saying? Are you saying make the syntax optional? If
> > > so, I would be against that as well. I want to have as little optional
> > > syntax as possible. It makes things more concrete that way.
> > 
> > Yes, I did say "optional".  I understand and agree that there should be as
> > little optional syntax as possible.  But this would make templates much more
> > readable, therefore more usable.  A small cost for a relatively large benefit.
> 
> 
> what does 
> 
> #if( true ) 
> //
> #else
> //
> #end
> 
> evaluate to?
> 

This syntax is not available yet. When
it is, it will evalute to:

//

We would like to include this with Velocity,
but the WebMacro syntax comes first. That's
what I'm working on. Bob is working on
the new syntax.

jvz.

> I use this for testing purpose.

You should stick with WM syntax for now
because that's what will be supported first.

jvz.

-- 

Jason van Zyl
jvanzyl@periapt.com


Re: dollar sign

Posted by Stefan Mainz <St...@Dynaware.de>.
Travis Low wrote:
> 
> Jon Stevens wrote:
> >
> > I don't get what you are saying? Are you saying make the syntax optional? If
> > so, I would be against that as well. I want to have as little optional
> > syntax as possible. It makes things more concrete that way.
> 
> Yes, I did say "optional".  I understand and agree that there should be as
> little optional syntax as possible.  But this would make templates much more
> readable, therefore more usable.  A small cost for a relatively large benefit.


what does 

#if( true ) 
//
#else
//
#end

evaluate to?

I use this for testing purpose.

Stefan
-- 
Dynaware Systemberatung GmbH                 Tel: +49 89
743130-15                 
Am Westpark 7                                Fax: +49 89
743130-05            
81373 Müchnen                                mobil: +49 171
6920761               
http://www.dynaware.de                      
mailto:Stefan.Mainz@Dynaware.de

Re: dollar sign

Posted by Jon Stevens <jo...@latchkey.com>.
on 9/4/2000 9:17 PM, "Travis Low" <tr...@dawnstar.org> wrote:

> Yes, I did say "optional".  I understand and agree that there should be as
> little optional syntax as possible.  But this would make templates much more
> readable, therefore more usable.  A small cost for a relatively large benefit.

you are allowing the removal of the reference that a variable is a variable.
i'm not sure how good that is. :-(

-jon

-- 
http://scarab.tigris.org/    | http://noodle.tigris.org/
http://java.apache.org/      | http://java.apache.org/turbine/
http://www.working-dogs.com/ | http://jakarta.apache.org/velocity/
http://www.collab.net/       | http://www.sourcexchange.com/



Re: dollar sign

Posted by Travis Low <tr...@dawnstar.org>.
Jon Stevens wrote:
> 
> I don't get what you are saying? Are you saying make the syntax optional? If
> so, I would be against that as well. I want to have as little optional
> syntax as possible. It makes things more concrete that way.

Yes, I did say "optional".  I understand and agree that there should be as
little optional syntax as possible.  But this would make templates much more
readable, therefore more usable.  A small cost for a relatively large benefit.

-- Travis Low  
   <ma...@dawnstar.org>
   <http://dawnstar.org/travis>

Re: dollar sign

Posted by Jon Stevens <jo...@latchkey.com>.
on 9/4/2000 9:02 PM, "Travis Low" <tr...@dawnstar.org> wrote:

>> imho, it is confusing.
>> 
>> i can hear users saying: "now when do i use the $ and when do i not use it?
>> do i have to put it in the ()? or does it work outside of the ()?"
> 
> "If you have to ask, then always use it."

I don't get what you are saying? Are you saying make the syntax optional? If
so, I would be against that as well. I want to have as little optional
syntax as possible. It makes things more concrete that way.

> Not being flippant.

I know. :-)

-jon

-- 
http://scarab.tigris.org/    | http://noodle.tigris.org/
http://java.apache.org/      | http://java.apache.org/turbine/
http://www.working-dogs.com/ | http://jakarta.apache.org/velocity/
http://www.collab.net/       | http://www.sourcexchange.com/



Re: dollar sign

Posted by Travis Low <tr...@dawnstar.org>.
Jon Stevens wrote:
> 
> imho, it is confusing.
> 
> i can hear users saying: "now when do i use the $ and when do i not use it?
> do i have to put it in the ()? or does it work outside of the ()?"

"If you have to ask, then always use it."

Not being flippant.

-- Travis Low  
   <ma...@dawnstar.org>
   <http://dawnstar.org/travis>

Re: dollar sign

Posted by Jon Stevens <jo...@latchkey.com>.
on 9/4/2000 8:59 PM, "Travis Low" <tr...@dawnstar.org> wrote:

> To simplify the syntax further, would it be possible to make the "$" optional
> within velocity statements?
> 
> #if( foo )
> blah
> #end
> 
> But it would still be required for things like:
> 
> <p>$foo</p>

imho, it is confusing.

i can hear users saying: "now when do i use the $ and when do i not use it?
do i have to put it in the ()? or does it work outside of the ()?"

-jon

-- 
http://scarab.tigris.org/    | http://noodle.tigris.org/
http://java.apache.org/      | http://java.apache.org/turbine/
http://www.working-dogs.com/ | http://jakarta.apache.org/velocity/
http://www.collab.net/       | http://www.sourcexchange.com/