Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!spool.mu.edu!news.cs.indiana.edu!ariel.unm.edu!nmsu!opus!ted From: ted@nmsu.edu (Ted Dunning) Newsgroups: comp.lang.scheme Subject: Re: ML-like type-checker for Scheme subset? Message-ID: Date: 17 May 91 22:08:26 GMT References: <5710@goanna.cs.rmit.oz.au> <1065@sys.uea.ac.uk> <5808@goanna.cs.rmit.oz.au> Sender: news@NMSU.Edu Organization: Computing Research Lab Lines: 32 In-reply-to: ok@goanna.cs.rmit.oz.au's message of 17 May 91 09:36:16 GMT In article <5808@goanna.cs.rmit.oz.au> ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes: In most Fortran, Pascal, C, ... implementations I have used, you can add two positive numbers and get a negative number. If you read the Fortran, Pascal, and C standards with sufficient care and attention, you will see that quietly delivering the wrong answers to integer arithmetic operations like this is _legal_. Implementations are _also_ free to report overflows (nice one, MIPS!) but often don't. Indeed, some systems makes it hard to _notice_ the overflow. (For example, one Pascal compiler I used on a 68010 _did_ generate code to trap on overflows, but the support routines for 32-bit multiplication and division forgot to set the V flag.) the terribly sad thing is that there are really two camps, one that assumes that doing arithmetic modulo 2^32 is natural, and one that assumes it is a *SIN*. the result is that when programming in c, i miss bignums in a terrible way, but when programming in prolog or lisp and trying to `simulate' real hardware, i take a _big_ hit in performance because i have to do a silly and redundant mod operation. why can't both sides realize that both options are important. -- if feeling bad is a justification for not living, then living is a justification for feeling good.