From: "Jean-Pierre Rosen" <rosen.adalog@wanadoo.fr>
Subject: Re: 'with'ing and 'use'ing
Date: 2000/03/01
Date: 2000-03-02T07:47:31+00:00 [thread overview]
Message-ID: <89l6aj$s5e$1@wanadoo.fr> (raw)
In-Reply-To: Pine.BSF.4.21.0002291409180.6230-100000@shell5.ba.best.com
As a known use-phile, I can't resist adding my 0.02 Euros...
Two issues:
1) Do not confuse using full names and forbidding use clauses. It is
perfectly possible to write full names while in the scope of a use clause
for a package. Sometimes, I use full names although I'm in scope simply
because I find that, for a particular name, I need a more accurate
description. Having a use clause leaves me the choice of the way I write it
on a case-by-case basis.
2) Use-phobes often consider only global "use", i.e. immediately following
the "with". The use clause is actually intended to open visibility only
where needed. My own preferred style is to put a use clause immediately
after the header of the innermost program unit that needs it *including when
the whole compilation unit needs it*, i.e. never after the with. For
example:
with Complex_Numbers, Text_IO;
package body Pack is
use Complex_Numbers; -- used everywhere in the package
...
procedure Put (X : Some_Type) is
use Text_IO; -- Text_IO used only in this procedure
...
end Put;
end Pack;
This really brings extra information, because you know precisely where each
package is actually used.
--
---------------------------------------------------------
J-P. Rosen (Rosen.Adalog@wanadoo.fr)
Visit Adalog's web site at http://pro.wanadoo.fr/adalog
next prev parent reply other threads:[~2000-03-01 0:00 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-02-29 0:00 'with'ing and 'use'ing Roger Hoyle
2000-02-29 0:00 ` Jeffrey Carter
2000-02-29 0:00 ` Brian Rogoff
2000-03-01 0:00 ` Jean-Pierre Rosen [this message]
2000-03-02 0:00 ` Charles Hixson
2000-03-02 0:00 ` Robert A Duff
2000-03-02 0:00 ` Ted Dennison
2000-03-02 0:00 ` Charles Hixson
2000-03-02 0:00 ` David Starner
2000-03-03 0:00 ` Ted Dennison
2000-03-07 0:00 ` Nick Roberts
2000-03-03 0:00 ` Jeff Carter
2000-03-03 0:00 ` David Starner
2000-03-04 0:00 ` Simon Wright
2000-03-03 0:00 ` Larry Kilgallen
2000-03-03 0:00 ` Marin D. Condic
2000-03-03 0:00 ` Scott Ingram
2000-03-04 0:00 ` Simon Wright
2000-03-04 0:00 ` Robert Dewar
2000-03-04 0:00 ` Ehud Lamm
2000-03-06 0:00 ` Charles Hixson
2000-03-06 0:00 ` Robert Dewar
2000-03-03 0:00 ` Charles H. Sampson
2000-03-04 0:00 ` Jean-Pierre Rosen
2000-03-06 0:00 ` Ted Dennison
2000-03-06 0:00 ` Robert Dewar
2000-03-07 0:00 ` Ted Dennison
2000-03-08 0:00 ` Robert Dewar
2000-03-11 0:00 ` Robert A Duff
2000-03-06 0:00 ` Ted Dennison
2000-03-06 0:00 ` Robert Dewar
2000-03-07 0:00 ` Ted Dennison
2000-03-07 0:00 ` Marin D. Condic
2000-03-06 0:00 ` Robert A Duff
2000-03-06 0:00 ` tmoran
2000-03-07 0:00 ` Marin D. Condic
2000-03-06 0:00 ` Charles H. Sampson
2000-03-07 0:00 ` Stuart Palin
2000-03-08 0:00 ` Robert Dewar
2000-03-09 0:00 ` Stuart Palin
2000-02-29 0:00 ` David Starner
2000-02-29 0:00 ` Robert A Duff
2000-02-29 0:00 ` Ted Dennison
2000-03-01 0:00 ` Robert Dewar
2000-02-29 0:00 ` xl
2000-02-29 0:00 ` Jeffrey Carter
2000-02-29 0:00 ` xl
2000-03-01 0:00 ` Roger Hoyle
2000-02-29 0:00 ` Ted Dennison
2000-03-01 0:00 ` Robert Dewar
2000-03-01 0:00 ` Ted Dennison
2000-03-01 0:00 ` Robert Dewar
2000-03-01 0:00 ` Ted Dennison
2000-03-01 0:00 ` Wes Groleau
2000-03-02 0:00 ` Robert Dewar
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox