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!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Mon, 05 Feb 2007 19:11:56 -0600 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <1170462379.446684.247730@q2g2000cwa.googlegroups.com> Subject: Re: Statically matching constraints Date: Mon, 5 Feb 2007 19:13:16 -0600 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1807 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-14NWh8s8eojw7Cxx50AiyOkYm0LuRjUeHw9wekxJRU+f9DzoFJkVmdJ+yt7+0zcfLAioJOYobv+s9rv!rGkvD1gUiG1L3rYw2DYmUhgAvzjEBRs5Ia14Z3/gbdXACSB2Acn4bKW378dPz8OEKqE8q0xkfekp!H2Y5CTn+DktVnQ== X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news2.google.com comp.lang.ada:8992 Date: 2007-02-05T19:13:16-06:00 List-Id: "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. Thus the two copies of T(Sub'Last) don't match. The notes in AARM 7.3(13.e-g) give a clue to the answer to your question. The AARM notes point out that you can't give a discriminant constraint in the partial view if it is a discriminant. The same holds true for any non-static value, because, by definition the two constraints are different and non-static: thus they don't match. (At least, that is how I interpret it.) Randy.