comp.lang.ada
 help / color / mirror / Atom feed
From: "David C. Hoos" <david.c.hoos.sr@ada95.com>
Subject: Re: Ranges and discriminant constraints
Date: Sat, 7 Jun 2003 21:22:11 -0500
Date: 2003-06-07T21:22:11-05:00	[thread overview]
Message-ID: <jYwEa.2963$7l6.2875@fe03.atl2.webusenet.com> (raw)
In-Reply-To: 665e587a.0306071258.1a8711cc@posting.google.com


"Vadim Godunko" <vgodunko@vipmail.ru> 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;

>
> Thanks,
> Vadim Godunko
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada.eu.org
> http://ada.eu.org/mailman/listinfo/comp.lang.ada
>
>





  parent reply	other threads:[~2003-06-08  2:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-07 20:58 Ranges and discriminant constraints Vadim Godunko
2003-06-07 21:51 ` AG
2003-06-08  6:00   ` Vadim Godunko
2003-06-08  7:45     ` Dmitry A. Kazakov
2003-06-08  2:22 ` David C. Hoos [this message]
2003-06-08  7:21   ` AG
replies disabled

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