comp.lang.ada
 help / color / mirror / Atom feed
From: "Björn Persson" <spam-away@nowhere.nil>
Subject: Re: subtype of enumeration type
Date: Mon, 20 Mar 2006 20:29:22 GMT
Date: 2006-03-20T20:29:22+00:00	[thread overview]
Message-ID: <CgETf.49155$d5.205462@newsb.telia.net> (raw)
In-Reply-To: <dvmas1$kj8$1@sunnews.cern.ch>

Maciej Sobczak wrote:
> Consider this:
> 
>    type Day is (Mon, Tue, Wed, Thu, Fri, Sat, Sun);
> 
> and the following standard example:
> 
>    subtype Weekday is Day range Mon .. Fri;
> 
> Now imagine that in some country children don't have to go to school on 
> Wednesdays, they go there only Monday, Tuesday, Thursday and Friday.
> 
> I want to say it in Ada.
> 
>    subtype Schoolday is Day <what goes here?>;

I think the best you can do is:

Is_Schoolday : constant array(Day) of Boolean :=
   (True, True, False, True, True, False, False);

-- 
Bj�rn Persson                              PGP key A88682FD
                    omb jor ers @sv ge.
                    r o.b n.p son eri nu



  parent reply	other threads:[~2006-03-20 20:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-20 13:31 subtype of enumeration type Maciej Sobczak
2006-03-20 14:26 ` Larry Kilgallen
2006-03-20 15:18   ` Maciej Sobczak
2006-03-20 15:37 ` Robert A Duff
2006-03-20 20:29 ` Björn Persson [this message]
2006-03-20 21:41 ` Jeffrey R. Carter
2006-03-21  8:37   ` subtypes and preconditions (was: subtype of enumeration type) Peter Amey
2006-03-21 17:42     ` subtypes and preconditions Jeffrey R. Carter
2006-03-21 19:00       ` Georg Bauhaus
2006-03-22  1:54         ` Jeffrey R. Carter
replies disabled

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