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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,33ce43bfeafb2681 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder.news-service.com!newsfeed.freenet.de!newsfeed-0.progon.net!progon.net!uucp.gnuu.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Concatenate enumeration Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: Date: Thu, 26 Nov 2009 09:59:48 +0100 Message-ID: NNTP-Posting-Date: 26 Nov 2009 09:59:48 CET NNTP-Posting-Host: abfcb253.newsspool4.arcor-online.net X-Trace: DXC=gNhiZ]7634IUK[6LHn;2LCV>7enW;^6ZC`4IXm65S@:3>?gn;Hh6>=n:3 X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:8237 Date: 2009-11-26T09:59:48+01:00 List-Id: On Wed, 25 Nov 2009 16:53:07 -0600, Randy Brukardt wrote: > "Robert A Duff" wrote in message > news:wcctywksu8t.fsf@shell01.TheWorld.com... > ... >>> You can't. Enumeration types are not extensible. >> >> Extensible enumeration types were proposed for Ada 9X, >> but were dropped. > > And were proposed again for Ada 2005, and were dropped again. See > AI95-0261-1. I doubt it will ever be proposed again. These are different things. I think the OP didn't want an extensible type. He wanted a new independent type constructed in some specific way. To extend an enumeration type E that has to have the class (E'Class). This is a lot of work. To reuse names of the literals of E in some other type, you only need reflection. E.g. an attribute, say, E'Domain, which would return "universal-set" of its literals, then you could write: type E is (None, Ready); type E1 is E'Domain or (Off); -- = (None, Ready, Off) Not very useful, but in other cases reflection could be very interesting. For example, in generics: generic type T is array; -- Only this package ... is -- The [first] array index type would be T'Index (1) -- The array element type would be T'Element etc -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de