comp.lang.ada
 help / color / mirror / Atom feed
From: sb463ba@l1-hrz.uni-duisburg.de (Georg Bauhaus)
Subject: Re: private "subtype"s
Date: 2000/10/10
Date: 2000-10-10T00:00:00+00:00	[thread overview]
Message-ID: <8s02li$8jv$1@news-hrz.uni-duisburg.de> (raw)
In-Reply-To: 8rt85j$hg7$1@nnrp1.deja.com

Ted Dennison:
: That makes a little bit of sense.

At least :-)  I started thinking it doesn't
and only made things awkwardly complex. So
would I be better off using some tagged records
for the following example?

package Society is

   type Person is
     (Dumb, Boring, Average, Skilled, Smart, Clever, Genius, Freaky);
   --  (rather incomplete)

end Society;

generic
   How_Many: Positive;
   --  counting the crowd
package Society.Club  is
-- sub-
   type Correct_People is private;
   --  a selection of more distinguished persons

   type Participants is
     array(1..How_Many) of Correct_People;

   procedure Party(P: Participants);
   procedure Celebrate(P: Participants) renames Party;
   --  stay PC

private
-- sub-
   type Correct_People is new Person
     range Smart..Genius;

end Society.Club;

generic
   How_Many: Positive;
   --  counting the crowd
package Society.Joe_Bloggs  is
-- sub-
   type Cheap_Flat_People is private;
   --  a selection of persons

   type Participants is
     array(1..How_Many) of Cheap_Flat_People;

   procedure Party(P: Participants);
   procedure Get_Drunk(P: Participants) renames Party;
   --  well, maybe

private
-- sub-
   type Cheap_Flat_People is new Person
     range Dumb..Average;
   --  if you can believe this

end Society.Joe_Bloggs;


The admittedly vague idea in the code
is to have someone like Groucho Marx enter the
Club and not having to be converted to another
type of person...
 But with "-- sub-"types below it looks like
requiring constraints to trigger similar things
like types can do. Yes, so there...





      reply	other threads:[~2000-10-10  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-09  0:00 private "subtype"s Georg Bauhaus
2000-10-09  0:00 ` Ted Dennison
2000-10-10  0:00   ` Georg Bauhaus [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