Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsfeed.utanet.at!newscore.univie.ac.at!aconews-feed.univie.ac.at!aconews.univie.ac.at!not-for-mail Newsgroups: comp.lang.java.programmer From: Andreas Leitgeb Subject: Re: Arithmetic overflow checking References: <015aeb15-57db-48ab-9cd4-77f8448b632f@w24g2000yqw.googlegroups.com> <1f9c17dltrhlmhifuigoa914477r4rg1e1@4ax.com> <09fe171s46ilvq9qmn254dctunm6noh0ps@4ax.com> <4e262731$0$314$14726298@news.sunsite.dk> <4e26300b$0$309$14726298@news.sunsite.dk> <4e26b4ed$0$2501$db0fefd9@news.zen.co.uk> <4e28097f$0$2533$da0feed9@news.zen.co.uk> <7a23c9d2-508f-4dbd-af91-8cdf2a9764e1@p29g2000pre.googlegroups.com> Reply-To: avl@logic.at User-Agent: slrn/pre0.9.9-111 (Linux) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: Date: 23 Jul 2011 21:03:14 GMT Lines: 34 NNTP-Posting-Host: gamma.logic.tuwien.ac.at X-Trace: 1311454994 tunews.univie.ac.at 73248 128.130.175.3 X-Complaints-To: abuse@tuwien.ac.at Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6480 David Lamb wrote: > On 22/07/2011 1:16 PM, Andreas Leitgeb wrote: >> I'm not sure which relation to the current discussion you might have had >> in mind for posting your example, but having to resort to some wordy >> prefix-notation instead of infix-notation, may indeed just be comparable >> to fiddling with native machine code libraries compared to jar-files. > I have done all of those things, and for me, having to deal with method > calls instead of infix (while annoying) is nowhere near as painful as > the library comparison. Comparing particular subjective painfulnesses doesn't contribute much to the discussion. It is my opinion, that operator overloading at least for a certain limited set of JSL classes (including BigDecimal and BigInteger as well as some new Complex class in addition to String's +), would be beneficial. Ditto for a new "strictint" keyword to enable detection and handling of integer overflows. There obviously won't be much agreement on how much effort these might be worth, and some may even claim that adding those would make Java worse. No consensus is likely to be reached here. And even if it were reached, chances would be neglectible that Java would grow a feature just because it reached consensus in c.l.j.p > Plus IMHO getting operator overloading *right* in a language isn't > exactly trivial. It's not horrible, but not trivial either. That's the kind of argument that made this posting worth answering. It becomes non-trivial when it comes to mixing types in expressions. There'd be some rules and maybe some "cannot"s but that wouldn't be a blocking point.