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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,45abc3b718b20aa3 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Two ideas for the next Ada standard Date: 1996/08/30 Message-ID: #1/1 X-Deja-AN: 177428055 references: <5009h5$ir4@netline-fddi.jpl.nasa.gov> <503sbo$j45@goanna.cs.rmit.edu.au> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-08-30T00:00:00+00:00 List-Id: In article <503sbo$j45@goanna.cs.rmit.edu.au>, Dale Stanbrough wrote: >...and given someone has started this thread :-) > >I presume the occasional murmers of unhappiness about the lack of utility >of private packages is due to the fact that they can't be 'with'ed by >a public {package|subprogram} spec because of the possibility of >revealing private details (is this right?). Perhaps people would be happier if they were called "body packages" -- a private child of X is more like the body of X, than the private part of X, in terms of visibility. In any case, I'm pretty happy with the rules as they are. >If this is the case then could we have... > > > with private fred; -- this does not mean fred is private! > -- perhaps "private with fred;" would be > -- better? Independent of the question of child packages, it is definitely an annoyance that a with_clause has to go up at the top, when you really only want it for the private part. The mistake, I think, is that the syntax requires with_clauses outside the unit -- it makes more sense to me, to put them inside: package X is with Y; ... private with Z; ... end X; But that ain't Ada. It's interesting that during the Ada 9X design, somebody proposed the exact same syntax you propose here, but with a totally different meaning. In particular, "with private Stuff;" would mean I can see the private part of Stuff -- it was proposed as an *alternative* to child units. > package mary is > > ... > private > -- can only use resources from fred in > -- the private section, e.g. for renames, > -- type completions etc. > end mary; >Gee, this is fun! :-). Language design is a *lot* of fun. - Bob