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: Robert A Duff Subject: Re: Subverting 'Access for Sub-programs Date: 1999/08/04 Message-ID: #1/1 X-Deja-AN: 508764351 Sender: bobduff@world.std.com (Robert A Duff) References: <37A71EF1.2201@dera.gov.uk> <37A7FDE8.4F5@dera.gov.uk> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1999-08-04T00:00:00+00:00 List-Id: 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. > "The Information contained in this E-Mail and any > subsequent correspondence is private and is intended > solely for the intended recipient(s). ... :-) :-) :-) - Bob -- Change robert to bob to get my real email address. Sorry.