Re: type coersion - numbers and booleans

2012-08-04 Thread Paul Stanton
While I agree with both of you - accessor methods in java classes is generally better than (minor) logic in templates, there are cases where some logic in templates is preferable, ie when there are perhaps 10's or more different numeric cases on the same property. having 10+ near identical

type coersion - numbers and booleans

2012-08-03 Thread Paul Stanton
hi all, originally have an accessor method: public int getNumericValue() { return myInteger; // auto-boxes to int } and wanted to use the following if: t:if test=numericValue == 3 however '==' doesn't work, but i know method calls work so i changed to: public

Re: type coersion - numbers and booleans

2012-08-03 Thread Howard Lewis Ship
public boolean isNumberThree() { return numericValue == 3; } Yes, there's some leaky abstractions with method invocations and all the parameter coercion going on. However, given live class reloading, creating ad-hoc properties for these comparisons is often more comparable. Also, instead of

Re: type coersion - numbers and booleans

2012-08-03 Thread Thiago H de Paula Figueiredo
On Fri, 03 Aug 2012 21:07:27 -0300, Howard Lewis Ship hls...@gmail.com wrote: public boolean isNumberThree() { return numericValue == 3; } In other words, don't put logic in templates, put them in Java classes, where it can be easily debugged and tested. ;) -- Thiago H. de Paula