Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!news.in2p3.fr!in2p3.fr!kanaga.switch.ch!switch.ch!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: 22 Jul 2011 17:16:46 GMT Lines: 24 NNTP-Posting-Host: gamma.logic.tuwien.ac.at X-Trace: 1311355006 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:6404 Joshua Cranmer wrote: > On 7/21/2011 9:03 AM, lewbloch wrote: >> On Jul 21, 8:38 am, Andreas Leitgeb >> wrote: >>> lewbloch wrote: >>>> And what about the suggestion to write a CheckedInteger type that does >>>> what you need? >>> Due to Java's lack of operator overloading, doing Math with >>> non-primitive types is just painful. >> I saw that suggestion, but painful != impossible. And "not impossible" != "a satisfying alternative". > No, painful is realizing that your attempts to make something work all > fail because you need to put together two libraries that need different > versions of the same library. Next step, writing a script to extract the > necessary symbols from library v2 but not in v1, dump those out as > assembly, and copy them over. 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.