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,7a5b8336407bf471,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-08 03:59:19 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!peer1.news.newnet.co.uk!news-peer.gradwell.net!not-for-mail Newsgroups: comp.lang.ada From: porton@ex-code.com (Victor Porton) Date: Fri, 08 Nov 2002 16:53:15 +0500 Subject: Safe "use" directive Mime-Version: 1.0 X-Newsreader: knews 1.0b.1 Content-Type: text/plain; charset=us-ascii Message-ID: <3dcba716$0$305$bed64819@news.gradwell.net> NNTP-Posting-Date: 08 Nov 2002 11:59:18 GMT NNTP-Posting-Host: 195.149.39.13 X-Trace: 1036756758 news.gradwell.net 305 mail2news/195.149.39.13 X-Complaints-To: news-abuse@gradwell.net Xref: archiver1.google.com comp.lang.ada:30580 Date: 2002-11-08T11:59:18+00:00 List-Id: I am willing to follow the following coding standard (in almost all cases) to improve code safety (I consider it a good coding style for everybody who uses "use"): Use "use X" directive for a package X only if the package meets the following criteria: The visible part of the package X declares nothing except of subtypes, (generic) subrountines dependent on types declared in visible part of X, and also (generic) subpackages (recursively) of X contain only subtypes dependent on types declared in visible part of X and subrountines dependent on types declared in visible part of X. This avoids the danger of initentedly "use"ing a subrountine from one package working on a type from an other package instead of assumed the-same-named subrountine from the second package. Do you agree that it is a good rule? (Don't say: never use "use", I am only about the case if one uses "use".) Can the current Ada stylistics checking tools enforce such a rule without too much effort? P.S. For packages not following this rule (e.g. some Ada.*), it is possible to create wrapper packages following the rule.