comp.lang.ada
 help / color / mirror / Atom feed
* Re: Safe "use" directive
@ 2002-11-12 22:03 Gautier direct_replies_not_read
  2002-11-18  1:57 ` Richard Riehle
  0 siblings, 1 reply; 6+ messages in thread
From: Gautier direct_replies_not_read @ 2002-11-12 22:03 UTC (permalink / raw)


Victor Porton:

>Use "use X" directive for a package X only if the package meets the
>following criteria:
[...]

Changing the meaning of "use X" would be a bit stupid IMHO (discussed)
but why not adding a "use limited X" ?
- "limited" is already an Ada keyword
- it is what you are looking for :-)
____________________________________________________________
Gautier  --  http://www.mysunrise.ch/users/gdm/index.htm#Ada

NB: For a direct answer, address on the Web site!

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963




^ permalink raw reply	[flat|nested] 6+ messages in thread
* Safe "use" directive
@ 2002-11-08 11:53 Victor Porton
  2002-11-08 17:18 ` Peter Richtmyer
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Victor Porton @ 2002-11-08 11:53 UTC (permalink / raw)


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.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-11-18  1:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-12 22:03 Safe "use" directive Gautier direct_replies_not_read
2002-11-18  1:57 ` Richard Riehle
  -- strict thread matches above, loose matches on Subject: below --
2002-11-08 11:53 Victor Porton
2002-11-08 17:18 ` Peter Richtmyer
2002-11-09 10:36 ` Gautier
2002-11-11 14:44 ` Ted Dennison

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox