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,799e6e37c90ca633 X-Google-Attributes: gid103376,public From: Robert A Duff Subject: Re: Future Ada language revisions? Date: 1998/10/29 Message-ID: #1/1 X-Deja-AN: 406120026 Sender: bobduff@world.std.com (Robert A Duff) References: <70lquh$mrp@netline.jpl.nasa.gov> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1998-10-29T00:00:00+00:00 List-Id: Brian Rogoff writes: > I take it that you've changed your mind then, since you were the author > of the "limited access to subprogram" proposal, and at the end of that > proposal you had recommended that it not be adopted. What changed your > mind? I dunno. I guess at the time I was mainly worried about gaining the concensus needed to standardize Ada 9X, and that required that we not place too much burden on those implementations that had already chosen the display approach for Ada 83. From a purely technical point of view, I have always thought that Ada 9X should allow passing nested procedures as parameters to unnested procedures. The two workarounds I know of (using generics, and making an explicit closure using tagged types) are somewhat ugly, IMHO. I suppose I won't be truly satisfied until I can pass an unnamed block (written in line) as a parameter, like I can in Smalltalk. Sigh. GNAT supports the 'Unrestricted_Access attribute, which can be used to pass nested procedures. Unfortunately, this attribute allows dangling pointers. I would much prefer one of the two proposals I mentioned before, since they gave the same power, but with no dangling pointers (compile-time-checked for the limited access-to-subp idea, and run-time checked for the other one). > I have mixed feelings; on one hand I *really* wish that Ada had this > feature, on the other I think that penalizing implementors who used > displays wouldn't have been such a good idea. If there is a future > enhanced Ada, this is one of those things that I hope makes it in there, > so I hope all implementors are at least looking at it now so the argument > of "too much change in too little time" no longer applies. GNAT uses the "trampoline" mechanism, and I think most other Ada 95 compilers use the static link mechanism, both of which easily support downward closures. Of course, even compilers that choose to use displays can support downward closures; it's just a bit more complicated. I've used Pascal compilers that used closures, and fully supported Pascal's procedures-as-parameters feature. - Bob -- Change robert to bob to get my real email address. Sorry.