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,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4103f02f9e6c4df2,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-02-12 05:46:11 PST Path: supernews.google.com!sn-xit-03!supernews.com!freenix!oleane.net!oleane!nnrp.oleane.net!not-for-mail From: "Thierry Lelegard" Newsgroups: comp.lang.ada Subject: Ada 0y wish list: "with private" Date: Mon, 12 Feb 2001 14:41:03 +0100 Organization: Guest of France Telecom Oleane's newsreading service Message-ID: <968p1e$8m7$1@s1.read.news.oleane.net> NNTP-Posting-Host: host226.canal-plus.fr Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: s1.read.news.oleane.net 981985135 8903 194.2.208.226 (12 Feb 2001 13:38:55 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Mon, 12 Feb 2001 13:38:55 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2014.211 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Xref: supernews.google.com comp.lang.ada:5158 Date: 2001-02-12T14:41:03+01:00 List-Id: Recently, several wishlist items for Ada 0y were posted in c.l.a. Like many old Ada users, I have a couple of them. I would like to propose one for discussion: a "with private" extension. The idea is to specify in a context clause of a unit spec that an external unit can be used only in the private part. Example: with A; with private B; package C is X : A.TA; private Y : B.TB; -- legal only in private part end C; There are two advantages: 1) Readability. The user of package C is only interested in the public interface of C. Reading "with private B", the user knows that he may safely ignore what the strange unit B is all about. 2) Use of private packages in private parts. Example: package Lib is ... private package Lib.Internals is .... with private Lib.Internals; package Lib.Public is .... private type TP is new Lib.Internals.TI ... end Lib.Public; The second point is, of course, more important than the first one. Some of my recent code could have been much simpler with such a possibility. In Ada 95, a private package cannot be referenced at all in the spec of a public package, even in the private part, since the context clause "with Lib.Internals" is simply refused. Two points: - The "with private" syntax is, of course, only a suggestion. - Maybe there is some implementation flaw that I missed. Any ideas or objections? -Thierry ____________________________________________________________________________ Thierry Lelegard, "The Jazzing Troll", Email: thierry.lelegard@canal-plus.fr CANAL+ Technologies, 34 place Raoul Dautry, 75516 Paris Cedex 15, France Tel: +33 1 71 71 54 30 Fax: +33 1 71 71 52 08 Mobile: +33 6 03 00 65 75 ____________________________________________________________________________