Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!seismo!rochester!ritcv!mjl From: mjl@ritcv.UUCP (Mike Lutz) Newsgroups: net.lang Subject: Re: Why displays are always faster than static links Message-ID: <701@ritcv.UUCP> Date: Wed, 26-Oct-83 09:56:58 EDT Article-I.D.: ritcv.701 Posted: Wed Oct 26 09:56:58 1983 Date-Received: Thu, 27-Oct-83 20:57:13 EDT References: vax2.779 Lines: 26 I sent a note to utcsrgv!peterr on this subject, showing one case where I think static links are a win over saving the previous value of for display level 'N' in the activation record of a procedure called at level 'N'. (Whew -- sorry about the run-on sentence.) The problem arises when formal procedure parameters are supported in the language. In such cases, when a procedure is passed as an argument, the actu- al information passed must include the entry point to the procedure's code, its lexical level, and some encoding of the accessing environment at the time of the call. It is this last requirement which motivates the use of static links. With static links, all that need be passed is a pointer to the sur- rounding parent's activation record; when the procedure is eventually invoked, the display can then be reconstructed by traversing the static link chain be- ginning at this point. Without the static chain, the entire display up to and including the parent's lexical level must be passed. One must, of course, evaluate the cost/benefit ratio in light of the expected frequency of such constructions. It is worth noting that there are program- ming styles that attempt to provide a modicum of information hiding in block structured languages by using procedure parameters. If anyone has a solution to this problem that is both space efficient and doesn't require static links, I'd like to know about it. Mike Lutz ritcv!mjl