From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c4cb2c432feebd9d X-Google-Thread: 1094ba,c4cb2c432feebd9d X-Google-Thread: 101deb,15c6ed4b761968e6 X-Google-Attributes: gid103376,gid1094ba,gid101deb,public X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wn14feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail From: "James Giles" Newsgroups: comp.lang.ada,comp.lang.fortran,comp.lang.pl1 References: <0ugu4e.4i7.ln@hunter.axlog.fr> <%P_cg.155733$eR6.26337@bgtnsc04-news.ops.worldnet.att.net> <6H9dg.10258$S7.9150@news-server.bigpond.net.au> <1hfv5wb.1x4ab1tbdzk7eN%nospam@see.signature> <2006052509454116807-gsande@worldnetattnet> Subject: Re: Ada vs Fortran for scientific applications X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1478 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1478 Message-ID: Date: Sun, 09 Jul 2006 23:07:22 GMT NNTP-Posting-Host: 12.72.112.203 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1152486442 12.72.112.203 (Sun, 09 Jul 2006 23:07:22 GMT) NNTP-Posting-Date: Sun, 09 Jul 2006 23:07:22 GMT Organization: AT&T Worldnet Xref: g2news2.google.com comp.lang.ada:5586 comp.lang.fortran:11861 comp.lang.pl1:1962 Date: 2006-07-09T23:07:22+00:00 List-Id: Martin Dowie wrote: > James Giles wrote: ... >> In most Ada implementations, as for most other languages, all >> the bit patterns in the representation of an INTEGER data type >> are valid integer values. > > That's not entirely true, the standard states Integer must include the > range �2**15+1 .. +2**15�1 - thus (usually) leaving -2**15 as a > possible 'default uninitialized' value. Well I allowed for that possibility. I made no absolute assertion. I said "most Ada implementations". In fact, most language definitions *allow* implementations to implement integers with a lot of flexibility. Most actual implementations use all the bit patterns their underlying hardware allows and *don't* use any of them for NOI (Not An Integer). And, let's not forget character data types (does your actual implementation have a value that means NOC - Not A Character?). What about booleans? Ada also has fixed point types, enumerations, records, etc. Does your actual implementation catch uses of undefined variables for all those? Indeed, does it even use NANs from the floating point hardware to detect uninitialized REALs? It's true: nearly all languages permit implementations to internally represent data with additional memory for the purpose of detecting and reporting uses of undefined variables (and for other reasons - like the value of a variable that was defined, but the expression involved an unhandled exception). In formal semantics, the idea is called a lifted domain. Applying it in software is expensive at run-time. Now, I've always liked the idea of using the anomalous value in two's complement integers (sign bit set, all others clear) as NOI. I don't think it's a likely implementation strategy unless it was treated that way in hardware. -- J. Giles "I conclude that there are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies." -- C. A. R. Hoare