comp.lang.ada
 help / color / mirror / Atom feed
From: "Jean-Pierre Rosen" <rosen.adalog@wanadoo.fr>
Subject: Re: Why both "with" and "use"?
Date: 1999/02/17
Date: 1999-02-17T00:00:00+00:00	[thread overview]
Message-ID: <7af68r$52o$1@platane.wanadoo.fr> (raw)
In-Reply-To: 7acj53$1vu@news3.newsguy.com

Samuel Mize a �crit dans le message <7acj53$1vu@news3.newsguy.com>...
>I do find it useful sometimes to be able to "with" a package without
>"using" it, to control namespaces and prevent annoying collisions.
>
All this discussion (and most of the reasons why some people do not
like the "use") comes from the fact that few people realize that the
use is not necessarily after the with! (and this comes from the
unfortunate examples in RM83, where *all* "use" were with "with").

My personal religion is to apply the use to the smallest region where
it is necessary. If I need a package in a procedure, I put a use in
the procedure. More precisely: if I need it for some declarations, I
put it at the top of the declarative part. If I need it only for
statements, I put it just before "begin", unless I need it only for
operators in which case I use a "use type". In some cases (like
needing Ada.Exceptions in an exception handler), I put a declare block
just for the use clause.
This provides me with very fine tracking of package usage. And since I
almost never use full names, the compiler will tell me if I forget to
"document" this way my usage of packages.

Actually, I wonder how people who always use expanded names can know
precisely how packages are used... (Point of information: I hate cross
checking with X-refs ;-).
---------------------------------------------------------
           J-P. Rosen (Rosen.Adalog@wanadoo.fr)
Visit Adalog's web site at http://perso.wanadoo.fr/adalog






  reply	other threads:[~1999-02-17  0:00 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-13  0:00 Why both "with" and "use"? Mike Silva
1999-02-13  0:00 ` Corey Minyard
1999-02-13  0:00   ` Matthew Heaney
1999-02-13  0:00     ` bill
1999-02-14  0:00       ` Matthew Heaney
1999-02-14  0:00       ` dewar
1999-02-14  0:00       ` dewar
1999-02-13  0:00     ` Tom Moran
1999-02-14  0:00       ` Matthew Heaney
1999-02-16  0:00     ` Samuel Mize
1999-02-17  0:00       ` Jean-Pierre Rosen [this message]
1999-02-18  0:00         ` dennison
1999-02-18  0:00           ` robert_dewar
1999-02-19  0:00             ` bourguet
1999-02-19  0:00               ` robert_dewar
1999-02-19  0:00             ` Robert I. Eachus
1999-02-19  0:00               ` robert_dewar
1999-02-23  0:00                 ` Robert I. Eachus
1999-02-19  0:00               ` Brian Hanson
1999-02-19  0:00                 ` robert_dewar
1999-02-19  0:00             ` dennison
1999-02-19  0:00           ` Matthew Heaney
1999-02-19  0:00             ` dennison
1999-02-19  0:00               ` robert_dewar
1999-02-19  0:00                 ` dennison
1999-02-19  0:00                   ` robert_dewar
1999-02-19  0:00                 ` Ada multiple string personalities. why so many? mike
1999-02-19  0:00                   ` robert_dewar
1999-02-19  0:00                   ` Tom Moran
1999-02-19  0:00                     ` Mike Silva
1999-02-22  0:00                       ` Brian Hanson
1999-02-18  0:00         ` Why both "with" and "use"? robert_dewar
1999-02-18  0:00           ` Jean-Pierre Rosen
1999-02-18  0:00             ` robert_dewar
1999-02-19  0:00               ` Jean-Pierre Rosen
1999-02-17  0:00       ` Matthew Heaney
1999-02-17  0:00       ` Jean-Pierre Rosen
1999-02-17  0:00       ` dennison
1999-02-17  0:00         ` Nick Roberts
1999-02-17  0:00         ` Samuel Mize
1999-02-13  0:00   ` mike
1999-02-13  0:00 ` Pat Rogers
1999-02-13  0:00   ` bill
1999-02-13  0:00     ` Matthew Heaney
1999-02-13  0:00     ` Pat Rogers
1999-02-13  0:00       ` Matthew Heaney
1999-02-13  0:00         ` bill
1999-02-14  0:00         ` Pat Rogers
1999-02-14  0:00           ` Bob Collins
1999-02-14  0:00             ` Pat Rogers
1999-02-16  0:00         ` Samuel Mize
1999-02-15  0:00     ` Jean-Pierre Rosen
1999-02-15  0:00       ` Ed Falis
1999-02-16  0:00         ` Jean-Pierre Rosen
1999-02-15  0:00 ` Jean-Pierre Rosen
replies disabled

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