On Friday, March 7, 2003, at 10:39 AM, bob mcwhirter wrote:


Jexl seems to implement 'div' as simple division, instead of
the pair with 'mod'.  I'd like to correct it.  Was this a design
though, for 'div' to be divison, and not the typical div operator?

-bob

It's supposed to be /. There is supposed to be a pairing of / and div,
% and mod as far as I can read the JSTL spec.

Yah, the semantics of '/' seem right, in that they perform division where ( int / int ) yields a float.

But 'div' should do real div, at least in my mind (though, I can
understand if you're following a broken spec) and yeild an integer
from (int div int), but it doesn't.

I have no real knowledge, but am guessing that the tokens 'div' and 'mod' are there to give people an alternative to having '/' in XML-ish looking things.



So, we have 2 ways to mod, 2 ways to divide, an 0 ways to div.


However, if you need both / and the real div, we should consider it.
It's a break from JSTL, something that worries me. (Although it can be
fairly argued we aren't compatible, I am hoping to get that way...)

I think division is obviously needed, but I don't know if we need 2 tokens to do it. Having 'div' to what most folks consider to be 'div' would be a Good Thing.

Then we should shoot 'mod' if we are going to break.


Hm. Would a idiv or something be sufficient? We'd have to document.

I'm going to re-read the JSTL spec to see if I messed this up.

geir

--
Geir Magnusson Jr                                   203-956-2604(w)
Adeptra, Inc.                                       203-434-2093(m)
[EMAIL PROTECTED]                                   203-247-1713(m)


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



Reply via email to