You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "Geir Magnusson Jr." <ge...@optonline.net> on 2000/12/08 05:30:40 UTC

enhancement of the #set directive

I checked in code for the #set that conforms to the directive syntax of
#<directive>( arg )

The use is 

   #set( expression )

where expression is the same expression valid in the 'old' #set, as in 

   #set expression

Aside from normalizing the grammar so it's self consistant, we also no
longer have the parsing ambiguities.

So you can use it anywhere, just like any other directive. So :

  #set( $foo = 1) ## Christoph can now put comments after set statements

and

  Send me #set($foo=["$10 and ","a cake"])#foreach($a in $foo)$a #end
please.

is possible if you really want to do that.

The 'old' set still works, but outputs a warning into the runtime log
when used, so you can go find them and fix them.

I propose that we deprecate and remove the 'old' set soon so people
aren't tempted to use it.

Again, the 'old'one still works, and you aren't required to use this
'inline'. It can be used in place of the 'old' set.

The testbed still works, so the 'old' set is fine.  There are some new
tests in the testbed, but am interested in any problems anyone has.

geir

-- 
Geir Magnusson Jr.                               geirm@optonline.com