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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ec1a210f9e3b089e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-08 00:20:33 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!enews.sgi.com!news-out.spamkiller.net!propagator2-maxim!news-in.superfeed.net!newsfeed01.tsnz.net!news.xtra.co.nz!53ab2750!not-for-mail From: "AG" Newsgroups: comp.lang.ada References: <665e587a.0306071258.1a8711cc@posting.google.com> Subject: Re: Ranges and discriminant constraints X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: <4tBEa.16019$JA5.308000@news.xtra.co.nz> Date: Sun, 8 Jun 2003 19:21:23 +1200 NNTP-Posting-Host: 219.88.62.202 X-Complaints-To: newsadmin@xtra.co.nz X-Trace: news.xtra.co.nz 1055056832 219.88.62.202 (Sun, 08 Jun 2003 19:20:32 NZST) NNTP-Posting-Date: Sun, 08 Jun 2003 19:20:32 NZST Organization: Xtra Xref: archiver1.google.com comp.lang.ada:38825 Date: 2003-06-08T19:21:23+12:00 List-Id: "David C. Hoos" wrote in message news:jYwEa.2963$7l6.2875@fe03.atl2.webusenet.com... > > "Vadim Godunko" wrote in message > news:665e587a.0306071258.1a8711cc@posting.google.com... > > Hello, > > > > Does anybody explain me why language allow constraint discriminant of > > discrete type to some value, but not allow constraint to range? > > To constrain a discrete type to a more narrow range, you use a subrtype -- > e.g.: > > type my_enum is (a, b, c, d, e); > > subtype my_constrained_enum is my_enum range b .. d; I think it's a little bit trickier that that. What the guy asked for is something like: X (my_enum) -- record Y my_enum subtype -- some constraint here Z -- subtype of X with discriminant Y Short of generics, any better ideas?