comp.lang.ada
 help / color / mirror / Atom feed
From: GOODENOUGH@A.ISI.EDU (John B. Goodenough)
Subject: Re: obsolete vs. removed from the library
Date: Wed, 11-Mar-87 17:29:23 EST	[thread overview]
Date: Wed Mar 11 17:29:23 1987
Message-ID: <8703172243.AA21683@ucbvax.Berkeley.EDU> (raw)
In-Reply-To: 12284668975.9.BRYAN@Sierra.Stanford.EDU

Doug Bryan asked a question using the following example:

	package P is end P;

	with P;
	procedure Q is begin null; end;

	package P is end P;

	with P;
	procedure Q is begin null; end;

He asserted that "the second compilation of P ... makes the implicit
specification of Q (which is in the library) obsolete."  He then went on to
ask "Does this mean that the second compilation of the body of Q is invalid
since it is a secondary unit of an obsolete spec?"

The problem with this question is that it's based on an invalid assumption,
namely, that there is an implicit specification for procedure Q that is the
library unit.  I can well understand why Doug may have this interpretation,
since it was my understanding of the RM at one time also, but when the
Language Maintenance Panel/Committee considered this issue (in AI-00199), it
concluded that there is no implicit specification for procedure Q that serves
as a library unit; instead, procedure Q's body is itself the library unit.
Specifically, AI-00199 says:

	A subprogram body  given in a  compilation unit (following  the
	context clause)  is  interpreted as  a  secondary unit  if  the
	program library already  contains a  subprogram declaration  or
	generic subprogram declaration with the same identifier; it  is
	otherwise interpreted as a library unit.

Now the consequences of this approved interpretation are that when P is
recompiled, library unit Q is made obsolete, so the second compilation of
procedure Q must be accepted; it is not a secondary unit of an obsolete
(implicit) specification.

"Obsolete" and "not in the library" are semantically equivalent, although a
given implementation may treat these states differently.  (In particular, an
implementation might "recompile" very quickly units that are obsolete, but
physically "in the library".)
-------

  reply	other threads:[~1987-03-11 22:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1987-03-08  7:02 obsolete vs. removed from the library Bryan
1987-03-11 22:29 ` John B. Goodenough [this message]
  -- strict thread matches above, loose matches on Subject: below --
1987-03-14 16:03 amn
replies disabled

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