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=2.3 required=5.0 tests=BAYES_00,HK_RANDOM_FROM, INVALID_MSGID,MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3dbf2f325f33ce35 X-Google-Attributes: gid103376,public From: czgrr Subject: Re: Elimination of "use" clauses Date: 1999/07/01 Message-ID: <7lfvbk$fhh$1@nnrp1.deja.com>#1/1 X-Deja-AN: 496021271 References: <377B5807.88B875E0@cs.york.ac.uk> X-Http-Proxy: 1.0 x22.deja.com:80 (Squid/1.1.22) for client 193.192.234.4 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Thu Jul 01 14:52:41 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT) Date: 1999-07-01T00:00:00+00:00 List-Id: In article <377B5807.88B875E0@cs.york.ac.uk>, Neil.Audsley@cs.york.ac.uk wrote: > Ideally, we would like to eliminate "use" clauses, necessitating the > replacement of each procedure call X by PackageName.X instead. > Is there a tool that does this? I don't know about a tool to do it automatically, but it would seem that the easiest way to do it manually, if you have to, is to remove one "use", recompile all and see what fails. Add in "package_name."s until everything compiles again, and repeat for all "use"s. If you are using a compiler which has an "Show definition of..." operation (like ObjectAda, for example), you can use that to find the package that a function call is in, but this may be more tedious than getting the compiler to find them all for you. P.S. Watch out for operators. Having added all the "package_name."s, it sometimes makes for better readability if you re-introduce the "use" (globally or in specific routines) solely for the purpose of accessing operators. Remember to comment it as such. P.P.S. Totally my opinion here, and I'm sure that a discussion of some sort will ensue as a result of this, but I believe that if one package is heavily accessed in another, then that normally justifies having a "use". Similarly, if there is a globally used, low-enough-level package (like one for a program-wide set of base declarations), then I "use" that package everywhere that I "with" it as standard. But it's up to you. Cheers, czgrr -- No email, please - reply to the newsgroup. My opinions are not necessarily those of my employer. Use any suggestions at your own risk. Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.