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@murlibobo.cs.mu.OZ.AU (Fergus Henderson) Subject: Re: Q: access to subprogram Date: 1996/07/28 Message-ID: <4tg1a8$ldn@mulga.cs.mu.OZ.AU>#1/1 X-Deja-AN: 170692187 references: <4rb9dp$qe6@news1.delphi.com> <4t7dvt$cbo@mulga.cs.mu.OZ.AU> <4tb4ii$5fc@mulga.cs.mu.OZ.AU> organization: Comp Sci, University of Melbourne newsgroups: comp.lang.ada Date: 1996-07-28T00:00:00+00:00 List-Id: bobduff@world.std.com (Robert A Duff) writes: >Ada's access-to-subprogram types are rather severely restricted. Yes, >you can make a pointer-to-nested-proc, but that pointer can't survive >longer than the immediately enclosing procedure. [...] >For a static-link implementation, a level-0 access-to-proc type can be >implemented as a single address (of the procedure's code). [...] >A display implementation can always implement access-to-subp as a single >address, at all levels. > >Does this help? Yes, thanks. I think I understand things now. >Fergus Henderson wrote: >>The way the Mercury implementation handles taking the address of a >>generic instance in a shared generic is to package up the generic >>instance data in basically the same way that the stack frame data in an >>enclosing procedure is packed up when you take the address of a nested >>procedure. So as long as you are already committed to being able to >>take the address of nested procedures, there is no distributed >>overhead -- I think. > >Yes, this makes sense, I think, but doesn't it imply that level-0 >access-to-proc types have a static link attached? That would constitute >a distributed overhead, would it not, given the stuff I said above? And >make the interface to C more painful? Yes, you're correct in all of the above. -- 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.