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-Thread: 1108a1,59ec73856b699922 X-Google-Attributes: gid1108a1,public X-Google-Thread: fdb77,5f529c91be2ac930 X-Google-Attributes: gidfdb77,public X-Google-ArrivalTime: 2003-05-12 11:25:28 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.java.advocacy,comp.object,comp.lang.ada Subject: Re: Using Ada for device drivers? (Was: the Ada mandate, and why it collapsed and died) Followup-To: comp.lang.ada Date: 12 May 2003 14:23:54 -0400 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: <9fa75d42.0304230424.10612b1a@posting.google.com> <4a885870.0304291909.300765f@posting.google.com> <416273D61ACF7FEF.82C1D1AC17296926.FF0BFD4934A03813@lp.airnews.net> <9fa75d42.0305010621.55e99deb@posting.google.com> <0-WcnWfafqsNpiyjXTWcqw@gbronline.com> <1051804573.732603@master.nyc.kbcfp.com> <3EBE9BD4.1050008@attbi.com> <3EBEEFA0.8060008@attbi.com> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1052764766 22470 128.183.235.92 (12 May 2003 18:39:26 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 12 May 2003 18:39:26 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.java.advocacy:63595 comp.object:63251 comp.lang.ada:37247 Date: 2003-05-12T18:39:26+00:00 List-Id: "Robert I. Eachus" writes: > John R. Strohm wrote: > > >>for I in 0..Number_of_Hands - 1 loop > > > > There is ABSOLUTELY NO EXCUSE in Ada for the above. Human beings learn to > > count starting at "one", not "zero". > > >> Deck: Card_Array(0..51); > > Same comment. > > Well, excuse me! I did not write that because I am a closet C > programmer. I wrote that in both cases because those values are used > in mod operations, the deck when initializing cards, the > Number_of_Hands in determining vulnerability and dealer. In both > cases, I could either have expressions like (I-1) mod 13 + 1, or I > mod 13. Guess which I chose. Ok. But now you are in the solution space, not the problem space :). Even professors get to be a little inconsistent :). Perhaps you should write: function Mod (I : in Card_Index_Type) return Card_Index_Type; which does what you want. -- -- Stephe