From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 5 May 93 09:50:12 GMT From: cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!howland. reston.ans.net!darwin.sura.net!sgiblab!munnari.oz.au!yoyo.aarnet.edu.au!news.ad elaide.edu.au!usenet@ucbvax.Berkeley (Andrew Dunstan,,2285592,) Subject: Re: Passing procedures as parameters to procedures. Message-ID: <1s82kk$dpm@huon.itd.adelaide.edu.au> List-Id: >>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 # #