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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC 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: ncohen@watson.ibm.com (Norman H. Cohen) Subject: Re: Q: access to subprogram Date: 1996/07/08 Message-ID: <4rr5tu$sap@watnews1.watson.ibm.com>#1/1 X-Deja-AN: 167191510 distribution: world references: <4rb9dp$qe6@news1.delphi.com> organization: IBM T.J. Watson Research Center reply-to: ncohen@watson.ibm.com newsgroups: comp.lang.ada Date: 1996-07-08T00:00:00+00:00 List-Id: In article , bobduff@world.std.com (Robert A Duff) writes: |> With |> displays, it is somewhat difficult to implement passing nested |> procedures as parameters, because you have to pass the display, which is |> not of compile-time-known size. The size of a display for a given procedure IS known at compile time. It is equal to the number of procedures that lexically surround that procedure (give or take one, depending on the details of a given implementation). In essence, a display is an array of pointers to the stack frames for the current activations of each subprogram surrounding the current subprogram. The array is typically small, fast access to the values of the array elements is crucial for efficient access to nonlocal variables, and the array indices needed for addressing nonlocal variables are always known at compile time, so the elements of this array are typically stored in registers. (By the way, I share Bob Duff's amazement at the noninclusion of downward closures--we called them downward at the time--in Ada 95, and I say this as one of those Bob described as urging the removal rather than the addition of proposed Ada-95 features. I viewed the inclusion of downward closures as the REMOVAL of an arbitrary restriction. The decision was not made in ignorance. Bill Taylor had made what I considered an irrefutable case for downward closures, showing how much easier it would be to write iterators if downward closures were allowed. It came down to a conflict between the interests of Ada programmers and the interests of a minority of Ada implementors, and in this case the interests of the few implementors using displays prevailed.) -- Norman H. Cohen ncohen@watson.ibm.com