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-Thread: 103376,ce896fd16cf323ae X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!newsfeed1.ip.tiscali.net!tiscali!newsfeed2.ip.tiscali.net!irazu.switch.ch!switch.ch!newsmi-eu.news.garr.it!NewsITBone-GARR!newsserver.cilea.it!news.crs4.it!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: Enumeration representation enhancement proposal Date: 19 Oct 2004 16:55:18 +0200 Organization: CRS4, Center for Adv. Studies, Research and Development in Sardinia Message-ID: References: <2t7sd8F1rsqh9U1@uni-berlin.de> NNTP-Posting-Host: jacob.crs4.it Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pietro.crs4.it 1098192741 28924 156.148.71.80 (19 Oct 2004 13:32:21 GMT) X-Complaints-To: news@nntpserver.crs4.it. NNTP-Posting-Date: 19 Oct 2004 13:32:21 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:5459 Date: 2004-10-19T13:32:21+00:00 List-Id: Wojtek Narczynski wrote: > >> Maybe this could be improved in Ada 2005? For example: > >> > >> type Mix_Code is (Red, Green, Blue, Grey); > >> > >> -- Modest proposal > >> > >> for Mix_Code use (Red => 1, Green => 2, Blue => 3, Grey => others); > >> > >> This should be relatively straightforward to implement, and would > >> cover most needs. > > > > The problem with this proposal it that (actual) values of the type > > would no longer satisfy the ordering criteria (that a machine < or > > > test will always have the same result as the corresponding > > canonical test). > > I don't follow, could you provide a sample Ada code which would be > problematic? for Colours use (Red => 1, Green => 2, Blue => 4, Muddy => others); if Muddy < Blue then -- Do we ever get here? Both 3 and 5 represents Muddy. The one -- is smaller than 4 (which represents Blue), the other one -- isn't. end if; end if; Greetings, Jacob -- "Only Hogwarts students really need spellcheckers" -- An anonymous RISKS reader