From: mcsun!sun4nl!gufalet.let.rug.nl!rug4!laverman@uunet.uu.net (Bert Laverma
Subject: Re: knotty generics problem
Date: 7 May 92 07:32:52 GMT [thread overview]
Message-ID: <1992May7.073252.22055@cs.rug.nl> (raw)
Andrew Dunstan wrote:
> Here is a fragment of abstracted Pascal code:
>
> procedure a(procedure b(procedure c));
> procedure d;
> .
> .
> b(d);
Nice ;-)
> I (and a number of people with better minds than mine!) have wracked
> my brains trying to think of a way to do this neatly in Ada. We have
> all failed!
> I know it is provided for in 9X, but is there some genius out there
> who can suggest a way to do it with Ada as she is now?
You'ld have to use generics, as it is possible to use a procedure as
generic parameter. The syntax specifies that as generic formal parameter
a subprogram_specification can be given (section 12.1). Subprogram
specifications however do not include generic subprogram specifications...
So, one level of procedure parameter would work, two wouldn't. mark
one for Pascal here ;-)
> (This example might seem contrived, but I assure you it comes from
> a working Pascal program.)
Then you'll have to wait for Ada9x...
Greetings, Bert
--
#include <std/disclaimer>
Bert Laverman, Dept. of Computing Science, Groningen University
Friendly mail to: laverman@cs.rug.nl The rest to: /dev/null
reply other threads:[~1992-05-07 7:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox