Newsgroups: comp.arch,comp.lang.lisp,comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!oitnews.harvard.edu!newsfeed.rice.edu!news.sesqui.net!news.bbnplanet.com!cpk-news-hub1.bbnplanet.com!EU.net!uknet!usenet1.news.uk.psi.net!uknet!psinntp!psinntp!news.columbia.edu!news.new-york.net!news.decus.org!eisner!kilgallen
From: kilgallen@eisner.decus.org (Larry Kilgallen)
Subject: Re: Theory #51 (superior(?) programming languages)
X-Nntp-Posting-User: KILGALLEN
Lines: 31
Organization: LJK Software
Message-ID: <1997Jan22.121634.1@eisner>
References: <5c5c65$9ed@news-rocq.inria.fr>
X-Trace: 853953400/20906
X-Nntp-Posting-Host: eisner.decus.org
Date: Wed, 22 Jan 1997 17:16:34 GMT
Xref: glinda.oz.cs.cmu.edu comp.arch:74527 comp.lang.lisp:24736 comp.lang.scheme:18012

In article <5c5c65$9ed@news-rocq.inria.fr>, harley@pauillac.inria.fr (Robert Harley) writes:
> Erik Naggum <erik@naggum.no> writes:
>>[...]
>>thank you.  you prove my point most eloquently: C does not give programmers
>>access to arithmetic condition known as "overflow".
> 
> What exactly is an "arithmetic condition"?  If you mean a carry or
> overflow flag, hardware may not have one for you to access.

Hardware is irrelevant.  If the hardware does not support such a check,
it should be generated by the compiler.  Of course if a language has no
way to report such an error, whether the compiled code detected such an
overflow or not is a secret.

>>as I said, A+1 is either A+1, 0 or -(A+1) in C.
> 
> A+1 is A+1.
> 
> In the ring "modulo 2^n, where n is the number of bits in the type",
> according to Mssrs Kernighan and Ritchie.  If you assumed a different
> ring (such as Z) that's tough.  You should read the language spec
> before pontificating in error.

If a language provides  modular arithmetic by default, it does not
meet the expectations of most programmers.  Most programmers do not
read language specifications.  Restricting one's interest to the
subset known as "good programmers" is not acceptable, since most
software is not written by "good programmers" (the other sort being
in much more plentiful supply and much cheaper).

Larry Kilgallen
