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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Position of "use" Date: Sat, 05 Jul 2014 09:12:59 +0200 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Injection-Date: Sat, 5 Jul 2014 07:13:02 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="673e6c11240c3c2df587b229453e8246"; logging-data="6885"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18VLarbSJDy0xVwHX/ljgww" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: Cancel-Lock: sha1:Ian7qmjRfA8LfvSGIezCF6xTlPU= X-Enigmail-Version: 1.6 Xref: news.eternal-september.org comp.lang.ada:20720 Date: 2014-07-05T09:12:59+02:00 List-Id: Le 05/07/2014 08:43, Victor Porton a écrit : > What is the difference between > > with X; use X; > package Y is > end Y; > > and > > with X; > package Y is > use X; > end Y; > > ? > A use clause (as well as any declaration) is usable from where it appears up to the associated "end". 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. Personal note: it is quite rare to need use clauses in context clauses (the first case), and my personal policy is to use use clauses, but restricted to the innermost scope where they are useful. Therefore, I tend to prefer the second solution. -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr