[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/emacs-24 r107900: Deprecate the ((lambda ..
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/emacs-24 r107900: Deprecate the ((lambda ...) ...) form. |
Date: |
Wed, 25 Apr 2012 23:06:36 -0400 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 107900
committer: Stefan Monnier <address@hidden>
branch nick: emacs-24
timestamp: Wed 2012-04-25 23:06:36 -0400
message:
Deprecate the ((lambda ...) ...) form.
* doc/lispref/functions.texi (Simple Lambda, Argument List):
* doc/lispref/eval.texi (Function Indirection): Avoid deprecated form.
modified:
doc/lispref/ChangeLog
doc/lispref/eval.texi
doc/lispref/functions.texi
etc/NEWS
=== modified file 'doc/lispref/ChangeLog'
--- a/doc/lispref/ChangeLog 2012-04-26 00:48:08 +0000
+++ b/doc/lispref/ChangeLog 2012-04-26 03:06:36 +0000
@@ -1,3 +1,8 @@
+2012-04-26 Stefan Monnier <address@hidden>
+
+ * functions.texi (Simple Lambda, Argument List):
+ * eval.texi (Function Indirection): Avoid deprecated form.
+
2012-04-26 Glenn Morris <address@hidden>
* book-spine.texi, elisp.texi, vol1.texi, vol2.texi:
=== modified file 'doc/lispref/eval.texi'
--- a/doc/lispref/eval.texi 2012-04-26 00:31:47 +0000
+++ b/doc/lispref/eval.texi 2012-04-26 03:06:36 +0000
@@ -305,6 +305,22 @@
Executing the function itself evaluates its body; this does involve
symbol function indirection when calling @code{erste}.
+ This form is rarely used and is now deprecated. Instead, you should write it
+as:
+
address@hidden
address@hidden
+(funcall (lambda (arg) (erste arg))
+ '(1 2 3))
address@hidden group
address@hidden smallexample
+or just
address@hidden
address@hidden
+(let ((arg '(1 2 3))) (erste arg))
address@hidden group
address@hidden smallexample
+
The built-in function @code{indirect-function} provides an easy way to
perform symbol function indirection explicitly.
=== modified file 'doc/lispref/functions.texi'
--- a/doc/lispref/functions.texi 2012-02-04 14:56:32 +0000
+++ b/doc/lispref/functions.texi 2012-04-26 03:06:36 +0000
@@ -267,13 +267,12 @@
@end example
@noindent
-We can call this function by writing it as the @sc{car} of an
-expression, like this:
+We can call this function by passing it to @code{funcall}, like this:
@example
@group
-((lambda (a b c) (+ a b c))
- 1 2 3)
+(funcall (lambda (a b c) (+ a b c))
+ 1 2 3)
@end group
@end example
@@ -288,8 +287,8 @@
@example
@group
-((lambda (a b c) (+ a b c))
- 1 (* 2 3) (- 5 4))
+(funcall (lambda (a b c) (+ a b c))
+ 1 (* 2 3) (- 5 4))
@end group
@end example
@@ -400,16 +399,16 @@
Here are some examples of argument lists and proper calls:
@smallexample
-((lambda (n) (1+ n)) ; @r{One required:}
- 1) ; @r{requires exactly one argument.}
+(funcall (lambda (n) (1+ n)) ; @r{One required:}
+ 1) ; @r{requires exactly one argument.}
@result{} 2
-((lambda (n &optional n1) ; @r{One required and one optional:}
- (if n1 (+ n n1) (1+ n))) ; @r{1 or 2 arguments.}
- 1 2)
+(funcall (lambda (n &optional n1) ; @r{One required and one optional:}
+ (if n1 (+ n n1) (1+ n))) ; @r{1 or 2 arguments.}
+ 1 2)
@result{} 3
-((lambda (n &rest ns) ; @r{One required and one rest:}
- (+ n (apply '+ ns))) ; @r{1 or more arguments.}
- 1 2 3 4 5)
+(funcall (lambda (n &rest ns) ; @r{One required and one rest:}
+ (+ n (apply '+ ns))) ; @r{1 or more arguments.}
+ 1 2 3 4 5)
@result{} 15
@end smallexample
=== modified file 'etc/NEWS'
--- a/etc/NEWS 2012-04-05 14:47:41 +0000
+++ b/etc/NEWS 2012-04-26 03:06:36 +0000
@@ -1052,6 +1052,8 @@
*** New function `special-variable-p' to check whether a variable is
declared as dynamically bound.
+*** The form ((lambda ...) ...) is deprecated.
+
** An Emacs Lisp testing tool is now included.
Emacs Lisp developers can use this tool to write automated tests for
their code. See the ERT info manual for details.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/emacs-24 r107900: Deprecate the ((lambda ...) ...) form.,
Stefan Monnier <=