comp.lang.ada
 help / color / mirror / Atom feed
From: cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!howland.
Subject: Re: Passing procedures as parameters to procedures.
Date: 5 May 93 09:50:12 GMT	[thread overview]
Message-ID: <1s82kk$dpm@huon.itd.adelaide.edu.au> (raw)

>From article <1993May4.154040@di.epfl.ch>, by Magnus.Kempe@di.epfl.ch (Magnus 
Kempe):
> : [Pascal code omitted]
> The solution is to make "D" visible.
> package Wrap_AD is
>   procedure D;
>   generic
>     with procedure B;
>   procedure A_G;
> end Wrap_AD;
> package body Wrap_AD is
>   procedure D is begin null; end D;
>   procedure A_G is
>   begin
>     B;
>   end A_G;
> end Wrap_AD;
> generic
>   with procedure Y;
> procedure X_G;
> procedure X_G is
> begin
>   Y;
> end X_G;
> procedure X is new X_G (Wrap_AD.D);
> procedure A is new Wrap_AD.A_G (X);
> ....
> A;
> ....
> 
> 
> Good enough?



Nope! Unfortunately, my original A is recursive, and in particular it
is called from with D. (I realise I should have told you this!) So,
since A must be generic, D must be nested inside it (a generic
procedure can only be called from within itself).

I believe that the problem is insoluble, since B needs to be both
generic (so it can be instantiated with D) and non-generic (so it can
be an actual generic parameter of A).


Good try, though.

BTW, the original code is not mine, and I don't feel that I can post
it on the net without the author's permission (he is currently on
study leave). Trust me that I have faithfully set out the essential
elements of it.




cheers


andrew


#  Andrew Dunstan                   #   There's nothing good or bad   #
#  net:                             #                                 #
#    adunstan@steptoe.adl.csa.oz.au #   but thinking makes it so.     #
#  or: andrewd@cs.adelaide.edu.au   #                                 #

             reply	other threads:[~1993-05-05  9:50 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-05-05  9:50 cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!howland. [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-05-10 22:56 Passing procedures as parameters to procedures Jack Dean
1993-05-06  9:39 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!howland.reston.ans.net!darwi
1993-05-06  7:33 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!howland.reston.ans.net!torn!
1993-05-05 21:35 cis.ohio-state.edu!news.sei.cmu.edu!ajpo.sei.cmu.edu!progers
1993-05-05 17:39 Robert Dewar
1993-05-05 17:35 Robert Dewar
1993-05-05 16:30 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!us
1993-05-05 11:40 cis.ohio-state.edu!news.sei.cmu.edu!firth
1993-05-04 23:44 cis.ohio-state.edu!magnus.acs.ohio-state.edu!zaphod.mps.ohio-state.edu!ho
1993-05-04 22:13 John Goodsen
1993-05-04 19:39 cis.ohio-state.edu!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!m
1993-05-04 16:41 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!howland.reston.ans.net!ira.u
1993-05-04 16:25 Mark A Biggar
1993-05-04 15:43 Tucker Taft
1993-05-04 14:29 cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uwm.edu!spool.mu.edu!
1993-05-04 13:59 Tucker Taft
1993-05-04 13:45 cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!howland.
1993-05-04 13:45 cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uwm.edu!cs.utexas.edu
1993-05-04 10:25 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!us
1993-05-03 20:36 Mark A Biggar
1993-05-03 19:07 cis.ohio-state.edu!magnus.acs.ohio-state.edu!zaphod.mps.ohio-state.edu!ho
replies disabled

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