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,5b0235b23a9db0f2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-01-31 19:29:30 PST Path: supernews.google.com!sn-xit-02!sn-xit-04!supernews.com!europa.netcrusader.net!199.60.229.5!newsfeed.direct.ca!look.ca!newsfeed1.earthlink.net!newsfeed.earthlink.net!newsmaster1.prod.itd.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3A78D813.D749722F@acm.org> From: Jeffrey Carter X-Mailer: Mozilla 4.7 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Supertypes RE: Extensible Enumerated types References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Thu, 01 Feb 2001 03:29:28 GMT NNTP-Posting-Host: 158.252.123.167 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 980998168 158.252.123.167 (Wed, 31 Jan 2001 19:29:28 PST) NNTP-Posting-Date: Wed, 31 Jan 2001 19:29:28 PST Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: supernews.google.com comp.lang.ada:4795 Date: 2001-02-01T03:29:28+00:00 List-Id: "Beard, Frank" wrote: > I like Jeff Creem's idea of: > > type Fruit_Type is (Apple, Orange); > type New_Fruit_Type is new Fruit_Type with (Pear, Kiwi); This seems like an excellent idea. The only difference between this and type New_Fruit_Type is (Apple, Orange, Pear, Kiwi); would be type conversions between the types: F : Fruit_Type := ...; N : New_Fruit_Type := ...; N := New_Fruit_Type (F); -- Always OK F := Fruit_Type (N); -- Raises Constraint_Error if N not in -- Apple .. Orange Are there any technical/implementation issues against this? -- Jeff Carter "We call your door-opening request a silly thing." Monty Python & the Holy Grail