comp.lang.ada
 help / color / mirror / Atom feed
From: Mehdi Saada <00120260a@gmail.com>
Subject: Re: discontinuous subtype without aspect
Date: Tue, 30 Jan 2018 09:31:48 -0800 (PST)
Date: 2018-01-30T09:31:48-08:00	[thread overview]
Message-ID: <6972f8eb-6130-4c47-b27a-f8dd0afeb171@googlegroups.com> (raw)
In-Reply-To: <b7590929-1b5f-4e14-b689-c86999142749@googlegroups.com>

> ...because people didn't want set constraints. I still fail to understand
why, as you point out, a static predicate is not quite a replacement. 
It is a replacement, but I thought it was a shame there existed now, two syntaxic constructs to express the same things.
subtype FOO is BAR range Val5..Val6;
subtype FOO is BAR with STATIC_PREDICATE => FOO in membership_choice;
The second can express much more, but they still overlap, which isn't nice and clean.
Beside, I get it that a range is continuous by definition, but I still think "range 1..5|8..9" could be read as "range 1..5 and range 8..9" or "in 1..5|8..9". Forbide that for arrays, and that would be it.
Or better, I can subtype FOO is BAR in Val5..Val6|Val10; No need for range at all anymore, even for arrays. "in" is all that's needed. Fewer keywords too. A tool could also easily, for matter of compatibility, parse existing code and change every and each "range X..Y" by "in X..Y", and qualify X and Y by the parent's subtype's name.
Is that what you mean by set constraints ?


  parent reply	other threads:[~2018-01-30 17:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-28 14:45 discontinuous subtype without aspect Mehdi Saada
2018-01-29 23:24 ` Randy Brukardt
2018-01-30 17:31 ` Mehdi Saada [this message]
2018-01-30 18:15   ` Dmitry A. Kazakov
2018-01-30 22:09   ` Randy Brukardt
replies disabled

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