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,6cb2525ffbfe23ce X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: Why both "with" and "use"? Date: 1999/02/19 Message-ID: #1/1 X-Deja-AN: 445914524 Sender: matt@mheaney.ni.net References: <36C5B28C.F32C43A4@jps.net> <7acj53$1vu@news3.newsguy.com> <7af68r$52o$1@platane.wanadoo.fr> <7ahq7p$s6k$1@nnrp1.dejanews.com> NNTP-Posting-Date: Thu, 18 Feb 1999 18:00:21 PDT Newsgroups: comp.lang.ada Date: 1999-02-19T00:00:00+00:00 List-Id: dennison@telepath.com writes: > In article <7af68r$52o$1@platane.wanadoo.fr>, > "Jean-Pierre Rosen" wrote: > > 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 ;-). > > A good point. But since named notation isn't used, you can't clearly see what > in that scope is from what package. Without resorting to a cross-referencing > tool you don't really know *how* the package is used, just roughly *where*. > > With named notation a simple textual search through the source will suffice. > No fancy tool required. T.E.D. True, but no fancy tool is required if you use certain naming conventions. If I see this: ... with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; package body P is ... procedure Op (...) is Text : Unbounded_String; begin then it doesn't require much imagination to realize that type Unbounded_String came from package Ada.Strings.Unbounded. Ditto for operations. Since most of the time operations that take a type as a parameter or return value are declared in the same package in which the type is declared, then that's where the operation is too. Expanded name notation and package renaming are used far more often than they need to be. Better to use these techniques when an operation or type is declared in an unobvious place.