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: 103376,583275b6950bf4e6 X-Google-Attributes: gid103376,public X-Google-Thread: 1108a1,59ec73856b699922 X-Google-Attributes: gid1108a1,public X-Google-ArrivalTime: 2003-05-12 19:29:57 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.airnews.net!cabal12.airnews.net!usenet From: "John R. Strohm" 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) Date: Mon, 12 May 2003 21:19:52 -0500 Organization: Airnews.net! at Internet America Message-ID: References: <9fa75d42.0304230424.10612b1a@posting.google.com> <9fa75d42.0305010621.55e99deb@posting.google.com> <0-WcnWfafqsNpiyjXTWcqw@gbronline.com> <1051804573.732603@master.nyc.kbcfp.com> <3EBE9BD4.1050008@attbi.com> <3EBEEFA0.8060008@attbi.com> Xref: archiver1.google.com comp.lang.java.advocacy:63617 comp.object:63266 comp.lang.ada:37259 Date: 2003-05-12T21:19:52-05:00 List-Id: X-A-Notice: References line has been trimed due to 512 byte limitation Abuse-Reports-To: abuse at airmail.net to report improper postings NNTP-Proxy-Relay: library2.airnews.net NNTP-Posting-Time: Mon, 12 May 2003 21:28:17 -0500 (CDT) NNTP-Posting-Host: !Zm:G1k-VJhXs^b (Encoded at Airnews!) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 "Robert I. Eachus" wrote in message news:3EBEEFA0.8060008@attbi.com... > 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. Actually, this one is a bit worse than it appears. You are assuming that #(suits)*#(cards in suit) = #(Card_Array). Change the definition of suits or cards, to e.g. add a new suit, or maybe add a new denomination, and you have to remember to change the magic number that represents the number of elements in the Cartesian product of the two sets.