I did a little cleanup of the VTL math. No new functionality was
added. This notice is really for John's documentation efforts, as well
as for discussion purposes.
This applies to the VTL math found in #set() statements, such as
#set($foo = $bar + 1 )
1) All operations are integer only. The args are checked to be
integers, and the result is an integer. If an arg is not an integer,
that is caught, logged, and null returned as the value of the
operation. (Think of what happens when you want to add a string to an
int :)
2) No longer will it toss an NPE when you use an invalid reference as an
arg on the RHS.
3) Div by 0 is caught for mod (%) and division(/).
On the discussion side, the question will come up is do we do
floating-point math. I can't see where it's appropos, for what it's
worth. Some believe that mathematical ops are totally inappropriate for
VTL, but I have used it myself for formatting tables. (I had an array
of items, and wanted to put N across before starting a new row....)
Thats about it. Happy Holidays, everyone.
geir
--
Geir Magnusson Jr. [EMAIL PROTECTED]
Velocity : it's not just a good idea. It should be the law.
http://jakarta.apache.org/velocity