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: "Dmitry A. Kazakov" Subject: Re: Subverting 'Access for Sub-programs Date: 1999/08/11 Message-ID: <37B18CF0.F50A802B@gandalf.atm.fh-luebeck.de>#1/1 X-Deja-AN: 511461359 Content-Transfer-Encoding: 7bit References: <37A71EF1.2201@dera.gov.uk> <37A7FDE8.4F5@dera.gov.uk> <7o9vrv$qgt$1@wanadoo.fr> <7oc5ih$6mb$1@wanadoo.fr> <7oejga$28i$1@nnrp1.deja.com> <37AEF7BF.7BBC8E06@averstar.com> <7oqahu$3s0$1@nnrp1.deja.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@de.uu.net Organization: Customer of UUNET Deutschland GmbH, Dortmund, Germany Mime-Version: 1.0 NNTP-Posting-Date: 11 Aug 1999 14:42:51 GMT Newsgroups: comp.lang.ada Date: 1999-08-11T14:42:51+00:00 List-Id: Robert Dewar wrote: > The discussion we were having is what should be done to the > language design if you abandon this annoying non-technical > consideration. > > It is in that context that I suggest that Unchecked_Access > would be appropriately allowed for subprograms with the > obvious semantics (if you absolutely *must* think in > implementation terms, the static link semantics that you > mention above :-) I believe that the actual problem is in using pointers. In 90%, I would say, there is no need to pass a subroutine by pointer. It should be passed by reference: What we need is something like (syntax is imaginary): type function ARealFunction (X : float) return float; function Integral (F : ARealFunction; From : float; To : float) return float is begin ... end; The key difference is that the function object must exist only at the call point which is clear from argument profile. The callee is unable to get its address and store it. In remaining 10% the restrictions on 'Access are meaningful and require no back doors. Regards, Dmitry