From: Tucker Taft <stt@averstar.com>
Subject: Re: Instantiating a generic formal procedure with an access procedure value
Date: 2000/01/04
Date: 2000-01-04T00:00:00+00:00 [thread overview]
Message-ID: <38725A42.2961CEFC@averstar.com> (raw)
In-Reply-To: 84rnbm$8jo$1@nnrp1.deja.com
Jeff Carter wrote:
>
> In article <3870E3F1.906FDFF4@averstar.com>,
> Tucker Taft <stt@averstar.com> wrote:
> > Jeff Carter wrote:
> > > procedure Op (Item : in out Handle; Item : in Integer);
> >
> > I presume you mean ------------------->>> Element : in Integer <<<
>
> Yes, thanks for pointing out that error.
>
> > > procedure Iterate (Action : in Action_Ptr) is
> > > procedure Local is new S_U.Iterate (Action => ???);
> > > -- What do I use here?
> >
> > Action.all is the name of a subprogram. It happens to have
> > convention "protected" but that is irrelevant to a generic
> > formal subprogram, which should accept subprograms of any
> > convention.
>
> I don't see why it should have convention "protected", since Action_Ptr
> is defined in the spec of package S and the actual procedure pointed to
> by a call to Iterate must be declared at the library level. However,
> that should be irrelevant.
You're right. I don't know what made me think that Action was
an access-to-protected subprogram. I must have been seeing things.
> s.adb:9:10: instantiation abandoned
> s.adb:9:63: missing argument for parameter "Element"
> s.adb:11:10: "Local" is undefined
>
> I realize that 3.12p is current, but I lack the bandwidth to download
> it right now. It may be a compiler error, and may be corrected in 3.12p
> or in compilers from other vendors, but I'd like confirmation that
> other compilers do accept this.
Your code compiles fine with My Favorite Front End.
This looks like a good old compiler bug. On the other hand,
it would still help if you included the complete source code,
exactly as it was submitted to GNAT. For example, I am surprised
GNAT didn't complain about lack of a generic body.
You have included bits and pieces, and it is quite possible that
there was some transcription error when I created a compilable version.
>
> Thanks for taking the time to think about this.
> --
> Jeff Carter
--
-Tucker Taft stt@averstar.com http://www.averstar.com/~stt/
Technical Director, Distributed IT Solutions (www.averstar.com/tools)
AverStar (formerly Intermetrics, Inc.) Burlington, MA USA
next prev parent reply other threads:[~2000-01-04 0:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-12-31 0:00 Instantiating a generic formal procedure with an access procedure value Jeff Carter
2000-01-03 0:00 ` Tucker Taft
2000-01-04 0:00 ` Jeff Carter
2000-01-04 0:00 ` Tucker Taft [this message]
2000-01-05 0:00 ` Jeff Carter
2000-01-05 0:00 ` Ed Falis
2000-01-12 0:00 ` Jeff Carter
2000-01-12 0:00 ` Simon Wright
2000-01-13 0:00 ` Jeff Carter
2000-01-13 0:00 ` Tucker Taft
2000-01-14 0:00 ` Jeff Carter
2000-01-13 0:00 ` Simon Wright
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox