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-13 22:00:13 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc54.POSTED!not-for-mail Message-ID: <3EC1CD51.9000006@attbi.com> From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Using Ada for device drivers? (Was: the Ada mandate, and why it collapsed and died) 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> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 24.62.164.137 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc54 1052888412 24.62.164.137 (Wed, 14 May 2003 05:00:12 GMT) NNTP-Posting-Date: Wed, 14 May 2003 05:00:12 GMT Organization: AT&T Broadband Date: Wed, 14 May 2003 05:00:12 GMT Xref: archiver1.google.com comp.lang.ada:37310 Date: 2003-05-14T05:00:12+00:00 List-Id: Stephen Leake wrote: > 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. First of all I would have to define: function "Mod" (I : Card_Index_Type) return Card_Index_Type; But I found the existing "mod" operator to be perfectly fine. However, what you are missing is the deeper truth that for enties that have this sort of behavior are best represented as modular types. If I had been able to write the program in Ada 95--this was written while working on the Ada 9X standard--I could have written: type Card_Index_Type is mod 52; Deck: array (Card_Index_Type) of Card; Would that make you happier?