From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e58bb9b46b60f0fb X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.com!newscon02.news.prodigy.com!prodigy.net!newsfeed.cwix.com!news.binc.net!kilgallen From: Kilgallen@SpamCop.net (Larry Kilgallen) Newsgroups: comp.lang.ada Subject: Re: subtype of enumeration type Date: 20 Mar 2006 08:26:44 -0600 Organization: LJK Software Message-ID: References: NNTP-Posting-Host: eisner.encompasserve.org X-Trace: grandcanyon.binc.net 1142864787 6987 192.135.80.34 (20 Mar 2006 14:26:27 GMT) X-Complaints-To: abuse@binc.net NNTP-Posting-Date: Mon, 20 Mar 2006 14:26:27 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:3488 Date: 2006-03-20T08:26:44-06:00 List-Id: In article , Maciej Sobczak writes: > 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 ; type Day is (Mon, Tue, Thu, Fri, Wed, Sat, Sun); subtype Weekday is Day range Mon .. Wed; subtype Schoolday is Day range Mon .. Fri; Some additional logic may also be in order if you print some some human-readable output based on an iteration over the range of Day or Weekday, such as by creating an index array Days_in_Order.