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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3e5f85a85cdab16e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-22 08:59:20 PST Newsgroups: comp.lang.ada Path: supernews.google.com!sn-xit-02!supernews.com!news.tele.dk!194.42.224.136!diablo.netcom.net.uk!netcom.net.uk!easynet-monga!easynet-tele!easynet.net!newspump.sol.net!nntp.msen.com!uunet!ash.uu.net!world!bobduff From: Robert A Duff Subject: Re: Should this be legal? Sender: bobduff@world.std.com (Robert A Duff) Message-ID: Date: Thu, 22 Mar 2001 16:51:03 GMT References: <99cjt2$v9g@newsserv.vs.dasa.de> Organization: The World Public Access UNIX, Brookline, MA X-Newsreader: Gnus v5.3/Emacs 19.34 Xref: supernews.google.com comp.lang.ada:6000 Date: 2001-03-22T16:51:03+00:00 List-Id: "Mark Lundquist" writes: > I believe your completion of type Derived is legal, but I'm not a language > lawyer... I *am* a language lawyer, but I don't know the right answer. I would have to go study the conformance rules. >...However, it seems like all the completion rules in 7.3 would > really be unnecessary if the partial and full views were required to "look > the same"... But we don't want them to *be* the same. Eg: type T is new Ancestor with private; private type T is new Parent with record ... is legal (and useful), if Parent is derived from Ancestor. > > But then, if Base_2 and Base(2) are supposedly interchangeable, > > how come the function Legal is accepted but function Illegal is > > refused ("constraint not allowed here") ? > > Because the construct that follows the "return" must be a subtype_mark, that > is, a name that denotes a (named) subtype (i.e. either the "first subtype" > of a type, or a subtype defined by a subtype declaration). What you have > there is actually just a syntax error. Right -- it's just a syntax error. But Oliver Kellogg asked *why*. I'm not sure, but an early version of Ada (1981?) allowed it. Probably something to do with when the expressions are elaborated. - Bob