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, T_FILL_THIS_FORM_SHORT 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-12 22:34:33 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!newsfeed.berkeley.edu!news-hog.berkeley.edu!ucberkeley!enews.sgi.com!harbinger.cc.monash.edu.au!newshub1.rdc1.nsw.optushome.com.au!news1.optus.net.au!optus!intgwpad.nntp.telstra.net!news-server.bigpond.net.au!not-for-mail From: Dale Stanbrough Newsgroups: comp.lang.ada Subject: Re: Ada 0y wish list: "with private" Organization: RMIT References: <968p1e$8m7$1@s1.read.news.oleane.net> User-Agent: MT-NewsWatcher/3.0 (PPC) Message-ID: Date: Tue, 13 Feb 2001 06:37:09 GMT NNTP-Posting-Host: 144.132.95.65 X-Complaints-To: news@bigpond.net.au X-Trace: news-server.bigpond.net.au 982046229 144.132.95.65 (Tue, 13 Feb 2001 17:37:09 EST) NNTP-Posting-Date: Tue, 13 Feb 2001 17:37:09 EST Xref: supernews.google.com comp.lang.ada:5212 Date: 2001-02-13T06:37:09+00:00 List-Id: 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