From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2308afbbe4ecec0b X-Google-Attributes: gid103376,public From: Brian Rogoff Subject: Re: Subverting 'Access for Sub-programs Date: 1999/08/04 Message-ID: #1/1 X-Deja-AN: 509051855 References: <37A71EF1.2201@dera.gov.uk> <37A7FDE8.4F5@dera.gov.uk> Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: nntp1.ba.best.com 933827235 219 bpr@206.184.139.136 MIME-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-08-04T00:00:00+00:00 List-Id: On Wed, 4 Aug 1999, Robert A Duff wrote: > Anton Gibbs writes: > > > Here, the problem is retaining visibility of the parameter F within the > > procedure whose 'Access I am trying to pass to the Perform operation. If > > I move Print_If_Multiple out to its own package (ie. out of the scope of > > Not_Main) then the only way I can see F is by using global data. I know > > this will work but I am reluctant to adopt this approach because I have > > often found that non-re-entrant code bites back in years to come when it > > gets re-used (usually by me) in a way the author never originally > > intended. > > There is no good solution to this problem: no solution that is portable, > concise, reentrant, &c. > > One thing you can do is declare a tagged type, and use an extension as > the environment of the procedure you want to pass -- then instead of > passing a procedure as a parameter, pass an object of the class-wide > type. This workaround would be a lot more effective if you could extend the tagged type at a deeper accessibility level than the parent. But you know that :-) -- Brian