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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6dd0409a547aa7b0 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!v45g2000cwv.googlegroups.com!not-for-mail From: "Adam Beneschan" Newsgroups: comp.lang.ada Subject: Re: Statically matching constraints Date: 5 Feb 2007 18:27:21 -0800 Organization: http://groups.google.com Message-ID: <1170728841.775115.214670@v45g2000cwv.googlegroups.com> References: <1170462379.446684.247730@q2g2000cwa.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1170728847 2932 127.0.0.1 (6 Feb 2007 02:27:27 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 6 Feb 2007 02:27:27 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: v45g2000cwv.googlegroups.com; posting-host=66.126.103.122; posting-account=cw1zeQwAAABOY2vF_g6V_9cdsyY_wV9w Xref: g2news2.google.com comp.lang.ada:8998 Date: 2007-02-05T18:27:21-08:00 List-Id: On Feb 5, 5:13 pm, "Randy Brukardt" wrote: > "Adam Beneschan" 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