comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeff Creem" <jeff@thecreems.com>
Subject: Re: Extensible Enummerated types FW: When will next Ada revision be? (83, 95, ?)
Date: Sat, 20 Jan 2001 11:19:59 -0500
Date: 2001-01-20T11:19:59-05:00	[thread overview]
Message-ID: <t6jeim807fic0a@corp.supernews.com> (raw)
In-Reply-To: 94c61v$h4a$1@nnrp1.deja.com


"Robert Dewar" <robert_dewar@my-deja.com> wrote in message
news:94c61v$h4a$1@nnrp1.deja.com...
> In article <mailman.979975693.13263.comp.lang.ada@ada.eu.org>,
>   comp.lang.ada@ada.eu.org wrote:
> > From: Bob Leif
> > To: Tucker Taft et al.
>
> > I believe that at one time you mentioned the possibility of
> > extending an enumerated type. This would greatly facilitate
> > object oriented programming.
>
> We did indeed consider this possibility, and I even think it
> was in one of the earlier mapping documents, but it was
> excluded because the implementation and description
> difficulties outweighed the usefullness, and further more
> for the specific examples presented, there seemed to be
> perfectly acceptable alternative methods of doing things.
>
> There is quite a bit of semantic structure in Ada that depends
> on knowing the possible set of enumeration types statically.


Of course I would find it useful (at times) to be able to extend the
set of an enumeration type (in a new derived type) even without having some
sort of a class based pointer to an arbitrary version of one of the new
types.

There are of course other perfectly acceptable methods but at times it would
be cleaner to be able to do things
like

type Fruit_Type is (Apple, Orange);
type New_Fruit_Type is new Fruit_Type with (Pear, Kiwi);

A : Fruit_Type := Apple;
B : New_Fruit_Type := New_Fruit_Type(A);


In the past when I have ran into situations like this (where for very
specific reasons I could not add anything
to Fruit_Type) I have resorted to enumeration indexed arrays of enumeration
type look-up tables for the
conversion...Not bad but not as clean as the above.



Whether the extra complexity this imposes on compiler writes (or language
learners) is worth the occasional
convenience is certainly debatable.






  reply	other threads:[~2001-01-20 16:19 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-20  7:26 Extensible Enummerated types FW: When will next Ada revision be? (83, 95, ?) Robert C. Leif, Ph.D.
2001-01-20 14:06 ` Robert Dewar
2001-01-20 16:19   ` Jeff Creem [this message]
2001-01-20 16:23     ` Mark Carroll
2001-01-20 19:18       ` Robert Dewar
2001-01-20 22:27         ` Brian Rogoff
2001-01-21 16:06           ` Robert Dewar
2001-01-21 23:08             ` Brian Rogoff
2001-01-22  2:02               ` Robert Dewar
2001-01-22 16:02                 ` Brian Rogoff
2001-01-22 16:50                   ` Robert Dewar
2001-01-22 21:12                     ` Brian Rogoff
2001-01-22 21:26                       ` Jean-Pierre Rosen
     [not found]                         ` <Pine.BSF.4.21.0101230839000.15065-100000@shell5.ba.best.com>
     [not found]                           ` <94rbdo$vf$1@wanadoo.fr>
2001-01-26 16:41                             ` LOF4 (Was Re: Extensible Enummerated types) Brian Rogoff
2001-01-20 22:34         ` Extensible Enummerated types FW: When will next Ada revision be? (83, 95, ?) Mark Carroll
2001-01-21 16:09           ` Robert Dewar
2001-01-21 19:04             ` Mark Carroll
2001-01-21 19:26               ` Robert Dewar
2001-01-21 21:12                 ` Mark Carroll
2001-01-21 17:47     ` Nick Roberts
2001-01-21 19:37       ` Robert Dewar
2001-01-22 17:26         ` Mark Lundquist
2001-01-22 20:47           ` Randy Brukardt
2001-01-22 21:41             ` Matthew Woodcraft
2001-01-30 16:17           ` Tucker Taft
2001-01-31  8:05             ` Extensible Enumerated " Robert C. Leif, Ph.D.
2001-02-10 20:34               ` Vincent Marciante
2001-01-31  8:05             ` Supertypes RE: Extensible Enumerated types Robert C. Leif, Ph.D.
2001-01-31 15:15               ` Marin David Condic
2001-02-01 22:03             ` Extensible Enummerated types FW: When will next Ada revision be? (83, 95, ?) Nick Roberts
2001-02-02  3:48               ` Robert Dewar
2001-02-02  4:41                 ` Jeffrey Carter
2001-02-02  7:26                   ` Robert C. Leif, Ph.D.
2001-02-02 16:38                     ` Robert Dewar
2001-02-02 20:39                     ` (Private message. Sorry) Nick Roberts
2001-01-22 15:02 ` Extensible Enummerated types FW: When will next Ada revision be? (83, 95, ?) Ted Dennison
2001-01-28  8:10   ` Robert C. Leif, Ph.D.
2001-02-02 21:54     ` Nick Roberts
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox