comp.lang.ada
 help / color / mirror / Atom feed
From: "Nick Roberts" <nickroberts@callnetuk.com>
Subject: Re: Extensible Enummerated types FW: When will next Ada revision be? (83, 95, ?)
Date: Fri, 2 Feb 2001 21:54:39 -0000
Date: 2001-02-02T21:54:39+00:00	[thread overview]
Message-ID: <95fao3$h0g97$2@ID-25716.news.dfncis.de> (raw)
In-Reply-To: mailman.980669544.10667.comp.lang.ada@ada.eu.org

Robert Leif's example seems to lead to a slightly hairier alternative (to
the simple proposal I made, unwittingly on behalf of Jeff Carter
apparently). Here, an enumerated type declaration, either a standard one,
e.g.:

   type Prefix_Type is (None, Mr, Ms, Miss, Mrs, Dr, Prof, Rev);

or a special one, e.g.:

   type Prefix_Type is (None, Mr, Ms, Miss, Mrs, Dr, Prof, Rev) with others;

declares a type which actually has more values (e.g. 256 or 65536) than are
specified. A size representation clause could be used to ensure a big enough
number are available. The first named subtype Prefix_Type denotes only the
declared values, as if the following had been declared:

   type {anon} is (None, Mr, Ms, Miss, Mrs, Dr, Prof, Rev);
   subtype Prefix_Type is {anon} range None..Rev;

so most things work as for current Ada. The other values have no designators
(but, I suppose, can still be referenced by using Val). A special kind of
declaration can then declare identifiers (or character literals) for these
values (starting at the first vacant position), e.g.:

   subtype New_Prefix_Type is Prefix_Type with (Guru, Ustad);

The new subtype New_Prefix_Type denotes the full new range None..Ustad. Note
how this allows multiple names to be declared for the same values:

  subtype My_Prefix_Type is Prefix_Type with (Master, Maestro);

It may be that an enumeration representation clause must be disallowed for
this kind of enumeration type. It may also be that the [Wide_]Image and
[Wide_]Value attributes must also be disallowed for such a type and any of
its subtypes.

Anyone saluting this alternative?

--
Nick Roberts
http://www.AdaOS.org






      reply	other threads:[~2001-02-02 21:54 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
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 [this message]
replies disabled

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