Commit 9c52d61d authored by Glenn Morris's avatar Glenn Morris
Browse files

Add some xrefs to cl.texi

* doc/misc/cl.texi (Porting Common Lisp, Lexical Bindings):
Add some xrefs to the Elisp manual.
parent 3c0c6155
2012-10-28 Glenn Morris <rgm@gnu.org> 2012-10-28 Glenn Morris <rgm@gnu.org>
* cl.texi (Porting Common Lisp, Lexical Bindings):
Add some xrefs to the Elisp manual.
* cl.texi (Lexical Bindings): Move to appendix of obsolete features. * cl.texi (Lexical Bindings): Move to appendix of obsolete features.
(Porting Common Lisp): Emacs Lisp can do true lexical binding now. (Porting Common Lisp): Emacs Lisp can do true lexical binding now.
(Obsolete Features): New appendix. Move Lexical Bindings here. (Obsolete Features): New appendix. Move Lexical Bindings here.
......
...@@ -4754,9 +4754,11 @@ Lexical scoping. In Common Lisp, function arguments and @code{let} ...@@ -4754,9 +4754,11 @@ Lexical scoping. In Common Lisp, function arguments and @code{let}
bindings apply only to references physically within their bodies (or bindings apply only to references physically within their bodies (or
within macro expansions in their bodies). Traditionally, Emacs Lisp within macro expansions in their bodies). Traditionally, Emacs Lisp
uses @dfn{dynamic scoping} wherein a binding to a variable is visible uses @dfn{dynamic scoping} wherein a binding to a variable is visible
even inside functions called from the body. Lexical binding is even inside functions called from the body.
available since Emacs 24.1, so be sure to set @code{lexical-binding} @xref{Dynamic Binding,,,elisp,GNU Emacs Lisp Reference Manual}.
to @code{t} if you need to emulate this aspect of Common Lisp. Lexical binding is available since Emacs 24.1, so be sure to set
@code{lexical-binding} to @code{t} if you need to emulate this aspect
of Common Lisp. @xref{Lexical Binding,,,elisp,GNU Emacs Lisp Reference Manual}.
Here is an example of a Common Lisp code fragment that would fail in Here is an example of a Common Lisp code fragment that would fail in
Emacs Lisp if @code{lexical-binding} were set to @code{nil}: Emacs Lisp if @code{lexical-binding} were set to @code{nil}:
...@@ -4969,7 +4971,8 @@ body, without any effect on the global variable of the same name. ...@@ -4969,7 +4971,8 @@ body, without any effect on the global variable of the same name.
The most important use of lexical bindings is to create @dfn{closures}. The most important use of lexical bindings is to create @dfn{closures}.
A closure is a function object that refers to an outside lexical A closure is a function object that refers to an outside lexical
variable. For example: variable (@pxref{Closures,,,elisp,GNU Emacs Lisp Reference Manual}).
For example:
@example @example
(defun make-adder (n) (defun make-adder (n)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment