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: 103376,583275b6950bf4e6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-20 12:54:05 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsengine.sol.net!news-out.visi.com!petbe.visi.com!uunet!ash.uu.net!dca.uu.net!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Quality systems (Was: Using Ada for device drivers? (Was: the Ada mandate, and why it collapsed and died)) Date: 20 May 2003 15:54:04 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <3ec4b1c9$1@news.wineasy.se> <9fa75d42.0305161748.1735fc32@posting.google.com> <4W%xa.28765$cK5.11964@nwrdny02.gnilink.net> <1053353256.804734@master.nyc.kbcfp.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1053460444 22943 199.172.62.241 (20 May 2003 19:54:04 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 20 May 2003 19:54:04 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:37566 Date: 2003-05-20T15:54:04-04:00 List-Id: Vinzent Hoefler writes: > Robert A Duff wrote: > > Consider the weird > >semantics of "not" for non-binary modulii. > > Well, you get what you've asked for. :-) ;-) > Well, let's get an example out of my praxis. I got a kind of random > lookup table with 15 entries (yes, I know, this is silly, especially > because speed should have been a main concern when this was written > first) and I just want to go through that array in circles. So using a > modular type in that case would be what? Low level? High level? High level. > Currently this thing is written in assembly language, but if I'd ever > reengineer that in Ada I'd definitely use a (non-binary) modular type > for the index then (and an array with 16 entries instead). Of course, > as you pointed out, I could do the modulo arithmetic by hand, but why > if I can let the compiler handle it? Because it makes the code easier to understand if the "mod" is explicit. - Bob