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,4103f02f9e6c4df2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-02-13 03:59:27 PST Path: supernews.google.com!sn-xit-02!sn-xit-04!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Jeff Creem" Newsgroups: comp.lang.ada Subject: Re: Ada 0y wish list: "with private" Date: Tue, 13 Feb 2001 07:01:24 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <968p1e$8m7$1@s1.read.news.oleane.net> X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Complaints-To: newsabuse@supernews.com Xref: supernews.google.com comp.lang.ada:5217 Date: 2001-02-13T07:01:24-05:00 List-Id: I think I see a little better what you are trying to accomplish. I am still not sure I see where this is really useful. I probably have addressed similar problems in the past somewhat differently by putting stuff from your private part in the public area but then using the Export set features of Rational Apex to limit what other packages can with that special package. It does require a little more work on the part of the programmer but I think it addresses more cases. Perhaps (if it is not patented) we should look at the export set feature of Apex for inclusion in the language in some way. "Dale Stanbrough" wrote in message news:dale-1C6885.17292013022001@news-server... > Jeff Creem wrote: > > > I am not entirely wild about this. It seems like a great way to break the > > private abstraction and shoot > > yourself. If C needs to need to know that much about B then it should be a > > child of B. > > > > Sure having something like this lets you be a little sloppier about the > > interfaces you provide to users of > > your package but without more of an example my gut tells me that you are > > missing the reason things are > > put in the private section. > > > No, that's not the problem at all. It's not a matter of being > sloppy, it's about having the freedom to compose the abstractions > that you want to. > > For example i have a type declared in a private > package, and would like this internal private type to be part of > the completion of a public type in a public package in the > package hierarchy. I never want the internal private type to be public, > but Ada does not allow it. > > Currently we have compilation privacy - what i want is implementation > privacy. > > For example > > > package A is > end A; > > private package A.one is > type P1 is private; > procedure op1 (item : p1); > private > type P1 is something; > end; > > > > with A.one; -- can't do this. > package A.two is > type P2 is private; > > procedure op2 (Item : P2); > private > type P2 is new P1; > end; > > > with private A.one; -- would like to do this... > package A.two is > type P2 is private; > > procedure op2 (Item : P2); > private > type P2 is new P1; > end; > > Certainly we are giving nothing away - the only operations available > outside the hierarchy would be those declared in package A.two. > > Certainly it shouldn't be necessary to implement "with private", as > a simple change to the rules (you can with the package, but if it > is private, you can only mention it in the private section). > > What i want to do certainly does not compromise any of the data > hiding abilities of the language as it stands. It only affects how > things are compiled (it prevents clients from having to be recompiled > if an internal private component is recompiled). > > > dale