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 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-24 05:31:14 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.direct.ca!look.ca!newsfeed1.earthlink.net!newsfeed.earthlink.net!newsmaster1.prod.itd.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3B5D5E18.CA8BE58C@earthlink.net> From: "Marc A. Criley" Organization: Quadrus Corporation X-Mailer: Mozilla 4.73 [en] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Question about enumeration types References: <3B5D5EA5.F20EC9D7@ffi.no> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 24 Jul 2001 12:31:03 GMT NNTP-Posting-Host: 158.252.122.160 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 995977863 158.252.122.160 (Tue, 24 Jul 2001 05:31:03 PDT) NNTP-Posting-Date: Tue, 24 Jul 2001 05:31:03 PDT X-Received-Date: Tue, 24 Jul 2001 05:28:38 PDT (newsmaster1.prod.itd.earthlink.net) Xref: archiver1.google.com comp.lang.ada:10507 Date: 2001-07-24T12:31:03+00:00 List-Id: Reinert Korsnes wrote: > > 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 ? Well, if you add a variable name, a type name, a procedure name, etc., you also have to worry about about causing conflicts with existing variable, type, procedure, etc., names that have the same visibility, so there's nothing particularly different about adding enumeration literals. One technique I've seen used is to prefix each enumeration literal with its type name or some other convention. For your example: type E1 is (E1_A, E1_B, E1_C, E1_D, E1_E); Now you can add E1_Exit with no problem. Marc A. Criley Senior Staff Engineer Quadrus Corporation www.quadruscorp.com