Good point (and a legitimate solution).  But I'd personally still vote for
an integer division operator.  It'd be nice to stay away from Java syntax
for the template designers.  There's a number of presentation related areas
(e.g. deciding if a row in a list is even or odd) that could use integer
division.  Why not make it easy?

WILL


Jonathan:

> There is no particular need, after all:
>
> (5/2).intValue() => 2


----- Original Message ----- 
From: "Jonathan Revusky" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 27, 2003 3:49 PM
Subject: Re: Velocity Numerics [PATCH]


> Nathan Bubna wrote:
> > James Taylor said:
> >
> >>On Thu, 2003-06-26 at 18:08, Will Glass-Husain wrote:
> >
> > ...
> >
> >>>For div I think we have these options
> >>>     5  \  2
> >>>     5 div  2
> >>>     div (5,2)
> >>
> >>Another option, python uses 5 // 2 for floor division.
> >
> >
> > +1
> >
> > of the suggestions so far, i like that one best.  5 \ 2 isn't bad, but 5
// 2
> > is more visually distinct (less likely to confuse with 5 / 2 at a
glance) and
> > doesn't have another use.  5 div 2 is a little strange, and makes me
want to
> > try things like 5 mod 2 instead of 5 % 2.  :)  i think it'd be better to
stick
> > with symbols.  just my $0.02.
>
> Here's another solution for integer division. Don't bother with it.
>
> There is no particular need, after all:
>
> (5/2).intValue() => 2
>
> should give you what you want.
>
> (You guys were thinking so hard about this that I could smell the smoke
> over here in Spain. Thought I should throw you guys a bone... ;-))
>
> Cheers,
>
> Jonathan Revusky
> --
> lead developer, FreeMarker project, http://freemarker.org/
> Check out FreeMarker's powerful new XML transformation capabilities:
> http://freemarker.org/docs/xgui.html
>
> >
> > Nathan Bubna
> > [EMAIL PROTECTED]
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to