comp.lang.ada
 help / color / mirror / Atom feed
From: "AG" <ang@xtra.co.nz>
Subject: Re: Ranges and discriminant constraints
Date: Sun, 8 Jun 2003 09:51:55 +1200
Date: 2003-06-08T09:51:55+12:00	[thread overview]
Message-ID: <b7tEa.15312$JA5.298948@news.xtra.co.nz> (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...

> Does anybody explain me why language allow constraint discriminant of
> discrete type to some value, but not allow constraint to range?

If I understood you correctly you mean something like this: [?]

type abc is (a, b, c);
type test(y: abc) is record
  ...
z: test(a);      -- Which compiles
  vs
z: test(a..c);  -- Which doesn't

Assuming I did understand you correctly,
what would that construct do? The whole
point of a discriminant value is to select
one option out of available set. Ranges
as such are not true values in Ada (you
could do a search for a thread awhile
back which discussed arrays of "nothings"
which existed solely for the purpose of
passing their slices around just to implement
the ranges as variables).





  reply	other threads:[~2003-06-07 21:51 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 [this message]
2003-06-08  6:00   ` Vadim Godunko
2003-06-08  7:45     ` Dmitry A. Kazakov
2003-06-08  2:22 ` David C. Hoos
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