[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-diffs] /srv/bzr/emacs/trunk r106923: Update Variables chapter
From: |
Stefan Monnier |
Subject: |
Re: [Emacs-diffs] /srv/bzr/emacs/trunk r106923: Update Variables chapter of Lisp manual to handle lexical binding. |
Date: |
Tue, 24 Jan 2012 12:52:18 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) |
> +value under the default @dfn{dynamic binding} rules. Under
> address@hidden binding} rules, the value cell holds the variable's
> address@hidden value}. @xref{Variable Scoping}, for details.}.
A locally scoped variable will normally always have a void value cell
(there is no "global value" for them).
> + More precisely, a variable is void if its symbol has an unassigned
> +value cell (@pxref{Symbol Components}). Under Emacs Lisp's default
> +dynamic binding rules, the value cell stores the variable's current
> +(local or global) value; if a variable is void, trying to evaluate the
> +variable signals a @code{void-variable} error rather than a value.
> +But when a variable is lexically bound, it can have a local value
> +which is determined by the lexical environment, even if the value cell
> +is empty and the variable is technically void. @xref{Variable
> +Scoping}.
Maybe we should state more clearly that for lexically scoped variables,
the value is not stored in the symbol's value cell but elsewhere;
i.e. that for lexically scoped variables, the variable is completely
distinct from the symbol used to represent it in the source code (and
indeed the byte-compiler will not keep the symbols of those vars in the
byte-code it outputs).
Stefan