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,99ab4bb580fc34cd X-Google-Attributes: gid103376,public From: fjh@mundook.cs.mu.OZ.AU (Fergus Henderson) Subject: Re: Q: access to subprogram Date: 1996/07/25 Message-ID: <4t7dvt$cbo@mulga.cs.mu.OZ.AU>#1/1 X-Deja-AN: 170093134 references: <4rb9dp$qe6@news1.delphi.com> organization: Comp Sci, University of Melbourne newsgroups: comp.lang.ada Date: 1996-07-25T00:00:00+00:00 List-Id: rogoff@sccm.Stanford.EDU (Brian Rogoff) writes: >It was one of the refs in Norman Cohen's precis of the discussion, from >Randy Brukardt at RR Software. Here is the relevant excerpt: > >--------------------------------------------------------------------------- >To put the problem in a nutshell: > >If 'Access is allowed in generic bodies, generic code sharing requires >distributed overhead. (Or compilers have to do body analysis of generics >in order to prevent sharing on them). Having implemented shared generic handling for Mercury, without any distributed overhead as far as I am aware, I'm keen to understand in detail how this problem arises in Ada. >To explain this in detail, I'd have to give a crash course on the construction >of shared generics. However, here is a simplified version of the problem: >A shared generic passes in some way a pointer to a data area identifying the >generic, and containing its local objects. [Note that this exists in any but >the most simplified versions of sharing - any sharing algorithm which allows >data in the generic specification or body would have the problem]. >However, an access-to-subprogram does not know that the routine comes from >a generic, or even which generic. The solution to this problem in the >specification is to construct a 'wrapper' routine at instantiation time, >which knows about the appropriate generic instantiation. I think I follow you so far... >However, a wrapper cannot be built for 'Accesses in the generic body >inside the generic body. Can you explain in a bit more detail when this would be necessary, and why it is not possible? -- Fergus Henderson | "I have always known that the pursuit WWW: | of excellence is a lethal habit" PGP: finger fjh@128.250.37.3 | -- the last words of T. S. Garp.