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,d927b7ea9b65580a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-03 11:23:45 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: "private with" proposal Date: Tue, 3 Dec 2002 13:24:02 -0600 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <3dccc023$0$304$bed64819@news.gradwell.net> <3DD847CD.A3D78EE9@adaworks.com> <3DE5F0BB.E7D21384@brighton.ac.uk> <3DE66447.2D6@earthlink.net> <3DEC42E0.407B@earthlink.net> X-Newsreader: Microsoft Outlook Express 4.72.3612.1700 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3719.2500 X-Complaints-To: abuse@supernews.com Xref: archiver1.google.com comp.lang.ada:31389 Date: 2002-12-03T13:24:02-06:00 List-Id: Vincent Marciante wrote in message <3DEC42E0.407B@earthlink.net>... >Stephen Leake wrote: > >> You are correct, the "extra syntax" of "private" in the context clause >> is not strictly necessary; the compiler and reader could figure out >> what's going on. >> >> But what is the downside of having the extra syntax? > >Discussing in the same AI as the one pertaining to >visability _within_ hierarchies confuses to issue. The entire point is that visibility is the wrong model for this. The syntax is tied to a legality rule (not a visibility rule), in order that added or removing 'private' or moving a declaration from the private part to the visible part does not silently change the meaning of a program. (This is covered in the AI). A secondary issue is the desire to think of the private part as a separate part. We discussed allowing separate compilation of private parts; in that case, 'private with' is just the context clause of the private part. The visibility rules are already way too complex in Ada, and your suggestion would make them even more complex. Moreover, changing a unit from private to non-private (or vice-versa) could silently change the meaning of a program from one legal meaning to a different legal meaning. (Currently, any such program is illegal, as the with would be illegal when the unit is private; with 'private with' as currently described, the use that causes the problem would be illegal.) In any case, 'private with' is easy to describe, easy to understand, easy to use, and easy to implement. A better solution (such as separate compilation of private parts) may exist, but waiting for the perfect solution to an important problem when we have an adequate solution that we can use now would be a mistake. Randy Brukardt