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 X-Google-Thread: 103376,6cb2525ffbfe23ce X-Google-Attributes: gid103376,public From: "Jean-Pierre Rosen" Subject: Re: Why both "with" and "use"? Date: 1999/02/17 Message-ID: <7af68r$52o$1@platane.wanadoo.fr>#1/1 X-Deja-AN: 445426783 Content-Transfer-Encoding: 8bit References: <36C5B28C.F32C43A4@jps.net> <7acj53$1vu@news3.newsguy.com> Content-Type: text/plain; charset="iso-8859-1" X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2120.0 Organization: Adalog Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-02-17T00:00:00+00:00 List-Id: 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