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,3254d965945d603a X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: How to prevent 'Unchecked_Access Date: 1996/10/23 Message-ID: #1/1 X-Deja-AN: 191574746 references: <54jarn$1rp@fozzie.sun3.iaf.nl> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-10-23T00:00:00+00:00 List-Id: In article <54jarn$1rp@fozzie.sun3.iaf.nl>, Geert Bosch wrote: >Isn't there a way to express this safe behavior at the subprogram, so >they can be used without using Unchecked_Access. A pragma specifying >that an access-type parameter is limited would seem logical. An earlier version of Ada 9X had limited access types. The feature was removed, primarily to simplify the language and keep the number of changes smaller. It wasn't anything against that feature in particular, as far as I remember. Well, there was something in particular against limited access-to-subprogram types. That's been discussed to death on this newsgroup. Access parameters can do more-or-less what you want, in many cases. You can take 'Access (instead of 'Unchecked_Access), and pass it to an access parameter, and as long as the called subprogram doesn't do anything evil (like assigning it into a global), all is well -- otherwise you get a run-time error. - Bob