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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2746dae4f161c04e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-27 06:08:33 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Use of use, was Re: Gtkada-Prob Date: 27 Nov 2001 09:06:32 -0500 Organization: NASA Goddard Space Flight Center Message-ID: References: <20011121.053507.496987743.3460@web.de> <20011121.113942.76065818.1437@web.de> <9tgoha$cib$1@drcomp.erfurt.thur.de> <3BFD6A62.123E6F49@acm.org> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1006870146 2157 128.183.220.71 (27 Nov 2001 14:09:06 GMT) X-Complaints-To: dscoggin@cne-odin.gsfc.nasa.gov NNTP-Posting-Date: 27 Nov 2001 14:09:06 GMT User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 Xref: archiver1.google.com comp.lang.ada:17042 Date: 2001-11-27T14:09:06+00:00 List-Id: "Anders Wirzenius" writes: > Preben Randhol wrote in message ... > >On Mon, 26 Nov 2001 06:47:54 GMT, Anders Wirzenius wrote: > >> Preben Randhol wrote in message ... > >> > >> I started to avoid the "use" a while ago and am nowadays merrily > returning > >> to code coded since that. > >> I second your advice, but why do you include the word "beginner" in your > >> advice? > >> Doesn't it apply to all programmers? > > > >Yes, but as a beginner these things can be a bit confusing. If you are > >experienced you should know what you have done wrong when the compiler > >complains about this :-) > > > > If I am a beginner and am advised to avoid "use" then when do I know that I > am not a beginner any more? Apparently I just KNOW. :-)) One way to know is when you get _really_ _really_ tired of Foo.Bar.func, and find yourself thinking "I have tools to tell me where 'func' is, I don't need to do this anymore!". (note; only being _really_ tired of it doesn't count :). > Well, there was another reason for asking my question: > > I sometimes long for a systematic list of the origin of utilized functions > and procedures. The compiler chooses, say, procedure Put from one of my, > say, five withed packages. The compiler could easily produce a list of > extended procedure names where it is shown from which package the Put is > fetched. It could be accomplished with an additional switch (Gnat: -gnatxn, > resulting in an extended ali file). The output should show the package name > and the library or source file where the package exists. > > Or have I missed an already existing possibility? One tool that does something similar to this is Emacs Ada mode, in conjunction with GNAT cross reference output. Put the cursor on a function call, hit ^C^D, and up pops the definition. Most compilers have some sort of "cross reference" output; I'm only familiar with GNAT. It would be straight-forward to write an ASIS tool to do this, that would be portable to any Ada compiler that supports ASIS. > > > Anders > > > -- -- Stephe