comp.lang.ada
 help / color / mirror / Atom feed
From: "Adam Beneschan" <adam@irvine.com>
Subject: Re: Statically matching constraints
Date: 5 Feb 2007 18:27:21 -0800
Date: 2007-02-05T18:27:21-08:00	[thread overview]
Message-ID: <1170728841.775115.214670@v45g2000cwv.googlegroups.com> (raw)
In-Reply-To: <w5qdnebRGv9ASFrYnZ2dnUVZ_u6rnZ2d@megapath.net>

On Feb 5, 5:13 pm, "Randy Brukardt" <r...@rrsoftware.com> wrote:
> "Adam Beneschan" <a...@irvine.com> wrote in message
>
> news:1170462379.446684.247730@q2g2000cwa.googlegroups.com...
>
> > I'm having a bit of trouble understanding the "both are nonstatic and
> > result from..." clause of 4.9.1(1.3/2).  According to 7.3(13), if you
> > have a discriminant on the ancestor subtype of a private extension,
> > the full definition must impose a statically matching constraint,
> > which takes you to 4.9.1.
>
> This rule hasn't changed since Ada 95 (other than to make it into a list of
> bullets in order to add a missing case for formal types).
>
> ...
>
> > My reading is that Pak1 and Pak2 are illegal but Pak3 seems to be
> > legal.  The constraints are all nonstatic (the fact that X is a
> > constant in Pak2 isn't enough to make it static), but it seems to me
> > that Pak3 is the only one where the constraint results from something
> > mentioned in 4.9.1(1.3/2), since it seems to result from "the same
> > evaluation of a range of a discrete_subtype_definition", while in Pak1
> > and Pak2 the constraints result from evaluations of a variable or
> > constant, respectively.  But it's a little confusing to me because I'm
> > not clear on just what "result from" is supposed to mean, and the AARM
> > is no help.
>
> > Is my interpretation correct?
>
> I don't think so. 7.3(13) is talking about the constraint of T in
> T(Sub'Last). Since Sub is not static, Sub'Last isn't static either, so the
> constraint of T(Sub'Last) isn't static.

But 4.9.1(1.3/2) seems to make it clear that two constraints can be
statically matching even if they're nonstatic, under certain
conditions.  (That seems to be the whole purpose of this paragraph:
static constraints are covered in the previous paragraph.) The
question is exactly what those conditions are, and the wording isn't
clear enough to me, for me to figure out whether that applies in the
Sub'Last example---that's the main point of my question.  7.3(13)
doesn't require that the two constraints involved be static---only
that they be staticlaly matching.

                                   -- Adam








      reply	other threads:[~2007-02-06  2:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-03  0:26 Statically matching constraints Adam Beneschan
2007-02-03 14:41 ` Ludovic Brenta
2007-02-06  1:13 ` Randy Brukardt
2007-02-06  2:27   ` Adam Beneschan [this message]
replies disabled

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