:: Re: [DNG] elisp &c
Forside
Slet denne besked
Besvar denne besked
Skribent: Hendrik Boom
Dato:  
Til: dng
Emne: Re: [DNG] elisp &c
On Wed, May 25, 2016 at 03:22:01PM +0100, Rainer Weikusat wrote:

>
>     The LISP "alist" implementation is, as we noted earlier, an
>     example of the "deep access" approach". The "alist" contains
>     pointers to previous values of all bound variables together with
>     the variable names. The name of the variable appears on the left
>     side of a pair, and the value of the variable on the right side.

>
>     [ftp://publications.ai.mit.edu/ai-publications/pdf/AIM-199.pdf,
>     p. 5]

>
>         [...] when one transmits a functional argument f which is to be
>         evaluated in its binding environment, then one uses FUNCTION(f)
>         instead of QUOTE(f). [...] The result of FUNCTION will be a
>         structure which not only contains a reference to the function f
>         but also contains a pointer to the binding environment. Thus at
>         the FUNARG's activation time we will be able to use the pointer
>         to restore the environment to the proper place.

>
>         [...]

>
>         In the "alist implementation, this process is even easier,
>         because the save pointer is made the current "alist", and we are
>         done because the values of free variables will be obtained from
>         the "alist" which contains the binding environment.
>         [p. 7, 8]


If you're using alists, lexical scoping is more efficient
than dynamic scoping, because you won't be searching lond association
lists all the time.

-- hendrik