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,60e2922351e0e780 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-18 00:32:53 PST Path: archiver1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!tar-atanamir.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: Clause "with and use" Date: Tue, 18 Nov 2003 09:35:44 +0100 Message-ID: References: <3FB6513B.DA6E53CA@fakeaddress.nil> NNTP-Posting-Host: tar-atanamir.cbb-automation.de (212.79.194.116) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 1069144372 56288777 212.79.194.116 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:2613 Date: 2003-11-18T09:35:44+01:00 List-Id: On Mon, 17 Nov 2003 09:38:50 -0500, "Robert I. Eachus" wrote: >Dmitry A. Kazakov wrote: > >> Exactly the same Ada would do. The effect should be defined to be >> literally same as for: >> >> with Foo; use Foo; with Bar; use Bar; >> >> So Foo.Bar cannot play any role here. Note that the proposal says >> *implies* "with Bar;". After all Foo.Bar cannot be "with"-ed and thus >> cannot be implied. > >And that is exactly the problem. I am sorry you don't see it. The with >clause has an effect on visibility that includes the use clause. >Current use clauses have a different scope. So if I see: > >with Foo; use Foo.Bar; > >which is currently legal and meaningful, what does your proposal do? > >The only choices I see are: > >1) The new rule you are proposing makes lots of existing legal Ada >programs illegal. > >2) That use clauses in context clauses are interpreted specially. First >applying one set of visibility and name resolution rules, then if that >fails silently applying another. > >3) Retain the current meaning of a use clause in a context clause, and >add a new context clause choice (I have been using "with and use") that >has the new meaning. > >To me option 1) is something that simply won't happen without a clear >and convincing need, and case 2) is worse. Do you have an option 4) >that I am unaware of? If not maybe you can now see why I think the >choice is between some veriation of 3) and no change. 2. However I would not call it another set of resolution rules. At least it is not much different from: with Foo.Bar; The compiler should first "imply" with Foo; and only then figure out what Foo.Bar might be. In the case with Foo; use Foo.Bar; Foo.Bar is not a library unit, so it cannot be implied. Formally we could appropriately extend 10.1.2(6). It refers to "library_item". Thus it cannot be applied to Foo.Bar, which is not a library item. A bit tricky, I should admit, but well in ARM style. (:-)) ----------- Well, option 4, scratching my scalp ... we could allow all packages to be "with"-ed: package A is package B is ... end B; with B; -- This is OK and does nothing end A; So: with Foo.Bar; -- This would be legal -- Regards, Dmitry Kazakov http://www.dmitry-kazakov.de