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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.66.216.130 with SMTP id oq2mr14682672pac.44.1404751510548; Mon, 07 Jul 2014 09:45:10 -0700 (PDT) X-Received: by 10.50.124.8 with SMTP id me8mr1525611igb.15.1404751510281; Mon, 07 Jul 2014 09:45:10 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!uq10no2405840igb.0!news-out.google.com!bp9ni2747igb.0!nntp.google.com!hn18no4601721igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 7 Jul 2014 09:45:09 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=KSa2aQoAAACOxnC0usBJYX8NE3x3a1Xq NNTP-Posting-Host: 66.126.103.122 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Position of "use" From: Adam Beneschan Injection-Date: Mon, 07 Jul 2014 16:45:10 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:20778 Date: 2014-07-07T09:45:09-07:00 List-Id: On Saturday, July 5, 2014 12:12:59 AM UTC-7, J-P. Rosen wrote: > Le 05/07/2014 08:43, Victor Porton a =EF=BF=BDcrit : >=20 > > What is the difference between >=20 > > with X; use X; > > package Y is > > end Y; >=20 > > and >=20 > > with X; > > package Y is > > use X; > > end Y; > > ? >=20 > A use clause (as well as any declaration) is usable from where it > appears up to the associated "end". >=20 >=20 > In the first case, it will allow short names for other with/use clauses, > while in the second case it will be effective only inside the package. Not true. This is illegal: with Ada; use Ada; with Strings.Unbounded; package X is ... You can't use this as a substitute for "with Ada.Strings.Unbounded". The visibility rules for context clauses are separate from visibility rules= in other cases. At the moment, I am not sure there is any difference at a= ll between Victor's two examples; I'll have to study the rules carefully to= make sure. It's possible that there is a difference if there is a child p= ackage (package X.Child is ...), or if there is a pragma in the context cla= use. I'll try to look at it later. -- Adam