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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fdb77,5f529c91be2ac930 X-Google-Attributes: gidfdb77,public X-Google-Thread: f43e6,899fc98b2883af4a X-Google-Attributes: gidf43e6,public X-Google-Thread: 103376,583275b6950bf4e6 X-Google-Attributes: gid103376,public X-Google-Thread: 1108a1,59ec73856b699922 X-Google-Attributes: gid1108a1,public X-Google-ArrivalTime: 2003-05-19 12:43:17 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.java.advocacy,comp.object,comp.lang.ada,comp.software-eng Subject: Re: Logic Errors and Ada (Was: A big hairy thread on Ada, Quality, and Drivers) Date: 19 May 2003 20:42:42 +0100 Organization: Pushface Sender: simon@smaug.pushface.org Message-ID: References: <9fa75d42.0304230424.10612b1a@posting.google.com> <9fa75d42.0305130543.60381450@posting.google.com> <254c16a.0305140549.3a87281b@posting.google.com> <9fa75d42.0305141747.5680c577@posting.google.com> <1053027582.984315@master.nyc.kbcfp.com> <3ec4b5c5$1@news.wineasy.se> <254c16a.0305160930.40bb42f9@posting.google.com> <9fa75d42.0305181502.53703035@posting.google.com> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1053373397 20514 62.49.19.209 (19 May 2003 19:43:17 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Mon, 19 May 2003 19:43:17 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: archiver1.google.com comp.lang.java.advocacy:64192 comp.object:63699 comp.lang.ada:37527 comp.software-eng:19301 Date: 2003-05-19T20:42:42+01:00 List-Id: martin.dowie@btopenworld.com (Martin Dowie) writes: > softeng3456@netscape.net (soft-eng) wrote in message news:<9fa75d42.0305181502.53703035@posting.google.com>... > > > > That sounds to me an unrealistic level of discipline: subtyping > > to the extent that all lattitudes and longitudes (and things > > along that line) are separate types. More common usage is that both > > will be just real numbers (floats), whatever the language chosen. So > > NO! That's just plain wrong - I've spent the last 15 years working in > aerospace and this is EXACTLY the level of typing that is used > EVERYDAY. My project is using 'subtype Radians is Long_Float' or equivalent, with constraints occasionally (though personally I don't now think that Radians can sensibly be constrained without a lot of work). Of course Latitude could be. The trouble is that the constraints won't catch that may errors (in UK waters, anyway). I've always thought that the pain of introducing full dimensional handling (without language support) is unjustifiable, and that if necessary one should rather go for records in this context: type Position is record Lat : Latitude; Long : Longitude; end record; and inspect the low-level support subprograms.