I say this without authority on the subject, but I'm guessing that the
parenthesis are used to help parse the strings.  As you may or may not have
noticed in the user's
guide<http://velocity.apache.org/engine/devel/user-guide.html#VTL:_Formatting_Issues>,
Velocity is white-space agnostic.  Thus, if the grammar allowed for your
usage pattern, a certain style would have to be set for us, otherwise it
wouldn't be known where the directive ends.

With regards to the curly braces, I will also point you to the user's
guide<http://velocity.apache.org/engine/devel/user-guide.html#formalreferencenotation>
section
on formal reference notation.  I found few cases where we needed to use
formal reference notation in any of our templates, but there are times when
it is worth knowing.

On Mon, Mar 26, 2012 at 3:36 AM, Nikhil G. Daddikar <n...@celoxis.com> wrote:

> Hello,
>
> I was looking at Velocity syntax and have a few questions.
>
> What is use of parenthesis in the #set directive: #set ($x = 1) Why not
> simply: #set $x = 1 ?
>
> Another question is regarding curly braces: What is the use of curly
> braces in the directives? E.g. #{set} ($x = 1)
>
> I am sure there are good reasons, just would like to know why.
>
> Thanks.
>
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: 
> user-unsubscribe@velocity.**apache.org<user-unsubscr...@velocity.apache.org>
> For additional commands, e-mail: user-h...@velocity.apache.org
>
>

Reply via email to