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,7dfca01aeef9a8c0,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-24 04:40:33 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!128.39.3.168!uninett.no!not-for-mail From: Reinert Korsnes Newsgroups: comp.lang.ada Subject: Question about enumeration types Date: Tue, 24 Jul 2001 13:40:21 +0200 Organization: UNINETT news service Message-ID: <3B5D5EA5.F20EC9D7@ffi.no> NNTP-Posting-Host: sthrkou.ffi.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: snipp.uninett.no 995974831 11207 193.156.99.159 (24 Jul 2001 11:40:31 GMT) X-Complaints-To: news-abuse@uninett.no X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.4.3-12 i686) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:10502 Date: 2001-07-24T13:40:21+02:00 List-Id: Hi, (sorry for somehow repeating a question) Given the program as below. Here I did put "E : E1" inside a record since "E" is also a possible value for the enumeration type E1. This is somehow verbose. Is it a more elegant way ? I find it boring that extending the range of possible values of an enumeration type may easily cause conflicts with variable names, and new variable names may cause conflicts values for enumeration types. I sometimes would like to have the reserved word "Exit" as a possible value of an enumeration type.... Am I thinking somewhat wrong ? reinert with Text_IO; use Text_IO; procedure Atest1 is type E1 is (A, B, C, D, E); package E1_Io is new Text_IO.Enumeration_Io (E1); use E1_Io; -- this conflicts with "E" as a possible value for type "E1" -- E : E1; type ARec_t is record E : E1; end record; ARec : ARec_t; begin ARec.E := A; Put(E1'First);Put(" ");Put(E1'Last); end Atest1;