comp.lang.ada
 help / color / mirror / Atom feed
From: Matthew Heaney <matthew_heaney@acm.org>
Subject: Re: Why both "with" and "use"?
Date: 1999/02/19
Date: 1999-02-19T00:00:00+00:00	[thread overview]
Message-ID: <m3ogmr40bj.fsf@mheaney.ni.net> (raw)
In-Reply-To: 7ahq7p$s6k$1@nnrp1.dejanews.com

dennison@telepath.com writes:

> In article <7af68r$52o$1@platane.wanadoo.fr>,
>   "Jean-Pierre Rosen" <rosen.adalog@wanadoo.fr> 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.









  parent reply	other threads:[~1999-02-19  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     ` Tom Moran
1999-02-14  0:00       ` Matthew Heaney
1999-02-13  0:00     ` bill
1999-02-14  0:00       ` dewar
1999-02-14  0:00       ` dewar
1999-02-14  0:00       ` Matthew Heaney
1999-02-16  0:00     ` Samuel Mize
1999-02-17  0:00       ` Jean-Pierre Rosen
1999-02-18  0:00         ` 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-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               ` Brian Hanson
1999-02-19  0:00                 ` robert_dewar
1999-02-19  0:00               ` robert_dewar
1999-02-23  0:00                 ` Robert I. Eachus
1999-02-19  0:00             ` dennison
1999-02-19  0:00           ` Matthew Heaney [this message]
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                   ` Tom Moran
1999-02-19  0:00                     ` Mike Silva
1999-02-22  0:00                       ` Brian Hanson
1999-02-19  0:00                   ` robert_dewar
1999-02-17  0:00       ` Why both "with" and "use"? Matthew Heaney
1999-02-17  0:00       ` Jean-Pierre Rosen
1999-02-17  0:00       ` dennison
1999-02-17  0:00         ` Samuel Mize
1999-02-17  0:00         ` Nick Roberts
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