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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c2f62556e56c9683 X-Google-Attributes: gid103376,public From: "Jean-Pierre Rosen" Subject: Re: 'with'ing and 'use'ing Date: 2000/03/01 Message-ID: <89l6aj$s5e$1@wanadoo.fr>#1/1 X-Deja-AN: 592128940 References: <38BC2EB3.2639372B@acm.org> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 X-Complaints-To: abuse@wanadoo.fr X-Trace: wanadoo.fr 951983251 28846 193.250.171.244 (2 Mar 2000 07:47:31 GMT) Organization: Adalog X-MSMail-Priority: Normal NNTP-Posting-Date: 2 Mar 2000 07:47:31 GMT Newsgroups: comp.lang.ada Date: 2000-03-02T07:47:31+00:00 List-Id: 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