Newsgroups: comp.arch,comp.lang.lisp,comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornellcs!newsstand.cit.cornell.edu!portc01.blue.aol.com!portc02.blue.aol.com!howland.erols.net!news.bbnplanet.com!cam-news-hub1.bbnplanet.com!news.mathworks.com!newsgate.duke.edu!news-server.ncren.net!hearst.acc.Virginia.EDU!murdoch!not-for-mail
From: clc5q@mamba.cs.Virginia.EDU (Clark L. Coleman)
Subject: Re: Theory #51 (superior(?) programming languages)
X-Nntp-Posting-Host: mamba-fo.cs.virginia.edu
Message-ID: <5cb9vd$qlf@mamba.cs.Virginia.EDU>
Sender: usenet@murdoch.acc.Virginia.EDU
Organization: University of Virginia
References: <3059948144828413@naggum.no> <1997Jan2108.28.23.6335@koobera.math.uic.edu> <3062850267355805@naggum.no> <1997Jan2123.11.15.1935@koobera.math.uic.edu>
Date: Fri, 24 Jan 1997 21:35:41 GMT
Lines: 31
Xref: glinda.oz.cs.cmu.edu comp.arch:74658 comp.lang.lisp:24826 comp.lang.scheme:18108

In article <1997Jan2123.11.15.1935@koobera.math.uic.edu>,
D. J. Bernstein <djb@koobera.math.uic.edu> wrote:
>In article <3062850267355805@naggum.no>, Erik Naggum  <erik@naggum.no> wrote:
>> thank you.  you prove my point most eloquently: C does not give programmers
>> access to arithmetic condition known as "overflow".
>
>Nonsense. I proved the opposite: the concept of ``overflow'' for
>unsigned additions is trivially expressible in C. A straightforward
>peephole optimizer will use the hardware's carry bit, if there is
>one.

Great work!

Now, let's see your example for signed arithmetic, so we can compare
it to something like:

if (INT_OVERFLOW) {
 :
 :
}
 in a hypothetical extension of C to detect overflow. Is your signed
int example as clean as your unsigned int example? What percentage of
real-world arithmetic is signed, do you suppose?



-- 
--------------------------------------------------------------------------
"I have prevented my kids from watching MTV at home. It's not safe for kids."
---- Tom Freston, MTV president, 4/14/95 Buffalo News.
 |||  clc5q@virginia.edu (Clark L. Coleman)
