comp.lang.ada
 help / color / mirror / Atom feed
From: "Beard, Frank" <beardf@spawar.navy.mil>
To: "'comp.lang.ada@ada.eu.org'" <comp.lang.ada@ada.eu.org>
Subject: RE: Supertypes RE: Extensible Enumerated types
Date: Wed, 31 Jan 2001 20:20:33 -0500
Date: 2001-01-31T20:20:33-05:00	[thread overview]
Message-ID: <mailman.980990522.2953.comp.lang.ada@ada.eu.org> (raw)

Bob,

I like Jeff Creem's idea of:

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

So your example would be:

-- from Package Prefix_Recs
type Prefix_Type is (None, Mr, Ms, Miss, Mrs, Dr, Prof, Rev,
    Other);

--From Package Prefix_Recs.Army
type Army_Prefix_Type is new Prefix_Type with (Private, Corporal, Sergeant,
Lieutenant, Captain, Major, Colonel, General);

Wouldn't this serve your purposes without the need of adding a new
reserved word?

Frank


-----Original Message-----
From: Robert C. Leif, Ph.D. [mailto:rleif@rleif.com]
Sent: Wednesday, January 31, 2001 3:05 AM
To: comp.lang.ada@ada.eu.org
Subject: Supertypes RE: Extensible Enumerated types 

> This is suggestion includes the addition of a new keyword to Ada. I
realize
> that some would consider this rank heresy.
>
> Since Ada has Subtypes to specify a subset of a type, it would be
reasonable
> to create a symmetrical operation to create a superset of a type.




             reply	other threads:[~2001-02-01  1:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-01  1:20 Beard, Frank [this message]
2001-02-01  3:29 ` Supertypes RE: Extensible Enumerated types Jeffrey Carter
2001-02-01 23:56   ` Nick Roberts
  -- strict thread matches above, loose matches on Subject: below --
2001-01-30 16:17 Extensible Enummerated types FW: When will next Ada revision be? (83, 95, ?) Tucker Taft
2001-01-31  8:05 ` Supertypes RE: Extensible Enumerated types Robert C. Leif, Ph.D.
2001-01-31 15:15   ` Marin David Condic
replies disabled

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