comp.lang.ada
 help / color / mirror / Atom feed
From: sun-barr!cs.utexas.edu!qt.cs.utexas.edu!news.Brown.EDU!noc.near.net!inmet !spock!stt@ames.arc.nasa.gov  (Tucker Taft)
Subject: Re: Generic Instantiation as Subprogram Body? (Clarification)
Date: 16 Oct 92 22:51:15 GMT	[thread overview]
Message-ID: <1992Oct16.225115.11359@inmet.camb.inmet.com> (raw)

In article <dnsurber.719094603@node_26400> 
dnsurber@lescsse.jsc.nasa.gov (Douglas N. Surber) writes:

> . . .
>There does not appear to be any clean way to use an instance of a
>generic as the implementation of a subroutine declared in a package spec
>without putting the instantiation in the spec itself.  If for some
>reason I wanted to implement a subroutine in that fashion, I wouldn't
>want that to be part of the spec.  It is an implementation detail and
>doesn't belong in the spec.  So, three questions:
>
>1) Is there anyway to do this other than the kludges I listed in my
>   original posting?
>
>2) If not, what was the rationale behind this restriction?
>
>3) Has this been fixed in Ada 9X?

Well, yes and no.  The current 9X proposals allow
the body of a subprogram to be a rename, including
a rename of an instantiation.

For readability and consistency reasons the body may not 
be an instantiation itself, since an instantiation
does not repeat the parameter profile, so correlating it
with the specification that it is implementing
is a potentially error-prone process in the presence of overloading.

Admittedly, allowing renames of instantiations but
not instantiations themselves seems a little arbitrary,
and we welcome comments on this issue if there are strong
feelings either way.

>Once again, I know lots of ways to implement relations, I am trying to
>understand a glitch in the language definition that improperly couples
>the specification of a package with its implementation.
>
>Douglas Surber
>Lockheed
>Houston, TX

S. Tucker Taft   stt@inmet.com
Ada 9X Mapping/Revision Team
Intermetrics, Inc.
Cambridge, MA

             reply	other threads:[~1992-10-16 22:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-10-16 22:51 sun-barr!cs.utexas.edu!qt.cs.utexas.edu!news.Brown.EDU!noc.near.net!inmet [this message]
  -- strict thread matches above, loose matches on Subject: below --
1992-10-19 13:23 Generic Instantiation as Subprogram Body? (Clarification) Douglas N. Surber
1992-10-14 20:30 Douglas N. Surber
replies disabled

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