Fix description of lexical environment's internals

* doc/lispref/variables.texi (Lexical Binding): Update the
description of how the lexical environment is represented
internally.  (Bug#62840)
This commit is contained in:
Eli Zaretskii 2023-04-18 14:30:28 +03:00
parent 1456adf424
commit 60560cc7ad

View file

@ -1183,13 +1183,16 @@ wants the current value of a variable, it looks first in the lexical
environment; if the variable is not specified in there, it looks in environment; if the variable is not specified in there, it looks in
the symbol's value cell, where the dynamic value is stored. the symbol's value cell, where the dynamic value is stored.
(Internally, the lexical environment is an alist of symbol-value (Internally, the lexical environment is a list whose members are
pairs, with the final element in the alist being the symbol @code{t} usually cons cells that are symbol-value pairs, but some of its
rather than a cons cell. Such an alist can be passed as the second members can be symbols rather than cons cells. A symbol in the list
argument to the @code{eval} function, in order to specify a lexical means the lexical environment declared that symbol's variable as
environment in which to evaluate a form. @xref{Eval}. Most Emacs locally considered to be dynamically bound. This list can be passed
Lisp programs, however, should not interact directly with lexical as the second argument to the @code{eval} function, in order to
environments in this way; only specialized programs like debuggers.) specify a lexical environment in which to evaluate a form.
@xref{Eval}. Most Emacs Lisp programs, however, should not interact
directly with lexical environments in this way; only specialized
programs like debuggers.)
@cindex closures, example of using @cindex closures, example of using
Lexical bindings have indefinite extent. Even after a binding Lexical bindings have indefinite extent. Even after a binding