comp.lang.ada
 help / color / mirror / Atom feed
From: "J-P. Rosen" <rosen@adalog.fr>
Subject: Re: Position of "use"
Date: Sat, 05 Jul 2014 09:12:59 +0200
Date: 2014-07-05T09:12:59+02:00	[thread overview]
Message-ID: <lp88ht$6n5$1@dont-email.me> (raw)
In-Reply-To: <lp86r0$ssl$1@speranza.aioe.org>

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

  reply	other threads:[~2014-07-05  7:12 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-05  6:43 Position of "use" Victor Porton
2014-07-05  7:12 ` J-P. Rosen [this message]
2014-07-07 16:45   ` Adam Beneschan
2014-07-07 17:08     ` Pascal Obry
2014-07-07 17:40       ` Peter Chapin
2014-07-07 19:17       ` Adam Beneschan
2014-07-08  5:26     ` J-P. Rosen
2014-07-08 15:32       ` Adam Beneschan
2014-07-08 19:30 ` Adam Beneschan
2014-07-08 22:39   ` Victor Porton
2014-07-09 10:36 ` anon
2014-07-09 15:14   ` Adam Beneschan
2014-07-10  1:27     ` anon
2014-07-10  9:50       ` AdaMagica
2014-07-10 13:10         ` J-P. Rosen
2014-07-10 15:57           ` Adam Beneschan
2014-07-10 17:47             ` Tero Koskinen
2014-07-10 19:15           ` Jeffrey Carter
2014-07-15  5:56         ` anon
2014-07-15  7:36           ` Georg Bauhaus
2014-07-15 17:01             ` Simon Wright
2014-07-15 17:23               ` Jeffrey Carter
2014-07-15 19:44                 ` Simon Wright
2014-07-15 17:47               ` G.B.
2014-07-15 17:51               ` Adam Beneschan
2014-07-15 20:04                 ` Simon Wright
2014-07-16  7:19                 ` anon
2014-07-10 15:54       ` Adam Beneschan
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox