aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2012-04-25 23:06:36 -0400
committerStefan Monnier2012-04-25 23:06:36 -0400
commit88ed9e87e565504e377ff3dfcdbacbbbeb382926 (patch)
tree607dc1be20d474389b4253174493d6b254695120
parent1a72be462423a71fa666a99854ccfaf422dfee96 (diff)
downloademacs-88ed9e87e565504e377ff3dfcdbacbbbeb382926.tar.gz
emacs-88ed9e87e565504e377ff3dfcdbacbbbeb382926.zip
Deprecate the ((lambda ...) ...) form.
* doc/lispref/functions.texi (Simple Lambda, Argument List): * doc/lispref/eval.texi (Function Indirection): Avoid deprecated form.
-rw-r--r--doc/lispref/ChangeLog5
-rw-r--r--doc/lispref/eval.texi16
-rw-r--r--doc/lispref/functions.texi27
-rw-r--r--etc/NEWS2
4 files changed, 36 insertions, 14 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index d65a8813fda..401b674f98b 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,8 @@
12012-04-26 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * functions.texi (Simple Lambda, Argument List):
4 * eval.texi (Function Indirection): Avoid deprecated form.
5
12012-04-26 Glenn Morris <rgm@gnu.org> 62012-04-26 Glenn Morris <rgm@gnu.org>
2 7
3 * book-spine.texi, elisp.texi, vol1.texi, vol2.texi: 8 * book-spine.texi, elisp.texi, vol1.texi, vol2.texi:
diff --git a/doc/lispref/eval.texi b/doc/lispref/eval.texi
index 5bb514451b8..62de337a5e3 100644
--- a/doc/lispref/eval.texi
+++ b/doc/lispref/eval.texi
@@ -305,6 +305,22 @@ function, not a symbol.
305Executing the function itself evaluates its body; this does involve 305Executing the function itself evaluates its body; this does involve
306symbol function indirection when calling @code{erste}. 306symbol function indirection when calling @code{erste}.
307 307
308 This form is rarely used and is now deprecated. Instead, you should write it
309as:
310
311@smallexample
312@group
313(funcall (lambda (arg) (erste arg))
314 '(1 2 3))
315@end group
316@end smallexample
317or just
318@smallexample
319@group
320(let ((arg '(1 2 3))) (erste arg))
321@end group
322@end smallexample
323
308 The built-in function @code{indirect-function} provides an easy way to 324 The built-in function @code{indirect-function} provides an easy way to
309perform symbol function indirection explicitly. 325perform symbol function indirection explicitly.
310 326
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi
index 9ee94557066..24fe9ed5e68 100644
--- a/doc/lispref/functions.texi
+++ b/doc/lispref/functions.texi
@@ -267,13 +267,12 @@ function is the value returned by the last element of the body.
267@end example 267@end example
268 268
269@noindent 269@noindent
270We can call this function by writing it as the @sc{car} of an 270We can call this function by passing it to @code{funcall}, like this:
271expression, like this:
272 271
273@example 272@example
274@group 273@group
275((lambda (a b c) (+ a b c)) 274(funcall (lambda (a b c) (+ a b c))
276 1 2 3) 275 1 2 3)
277@end group 276@end group
278@end example 277@end example
279 278
@@ -288,8 +287,8 @@ this example:
288 287
289@example 288@example
290@group 289@group
291((lambda (a b c) (+ a b c)) 290(funcall (lambda (a b c) (+ a b c))
292 1 (* 2 3) (- 5 4)) 291 1 (* 2 3) (- 5 4))
293@end group 292@end group
294@end example 293@end example
295 294
@@ -400,16 +399,16 @@ after a @code{&rest} argument.
400 Here are some examples of argument lists and proper calls: 399 Here are some examples of argument lists and proper calls:
401 400
402@smallexample 401@smallexample
403((lambda (n) (1+ n)) ; @r{One required:} 402(funcall (lambda (n) (1+ n)) ; @r{One required:}
404 1) ; @r{requires exactly one argument.} 403 1) ; @r{requires exactly one argument.}
405 @result{} 2 404 @result{} 2
406((lambda (n &optional n1) ; @r{One required and one optional:} 405(funcall (lambda (n &optional n1) ; @r{One required and one optional:}
407 (if n1 (+ n n1) (1+ n))) ; @r{1 or 2 arguments.} 406 (if n1 (+ n n1) (1+ n))) ; @r{1 or 2 arguments.}
408 1 2) 407 1 2)
409 @result{} 3 408 @result{} 3
410((lambda (n &rest ns) ; @r{One required and one rest:} 409(funcall (lambda (n &rest ns) ; @r{One required and one rest:}
411 (+ n (apply '+ ns))) ; @r{1 or more arguments.} 410 (+ n (apply '+ ns))) ; @r{1 or more arguments.}
412 1 2 3 4 5) 411 1 2 3 4 5)
413 @result{} 15 412 @result{} 15
414@end smallexample 413@end smallexample
415 414
diff --git a/etc/NEWS b/etc/NEWS
index 68a4d57eff2..e87bcaec0f0 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1052,6 +1052,8 @@ So do `defcustom' and other forms that call `defvar' as a subroutine.
1052*** New function `special-variable-p' to check whether a variable is 1052*** New function `special-variable-p' to check whether a variable is
1053declared as dynamically bound. 1053declared as dynamically bound.
1054 1054
1055*** The form ((lambda ...) ...) is deprecated.
1056
1055** An Emacs Lisp testing tool is now included. 1057** An Emacs Lisp testing tool is now included.
1056Emacs Lisp developers can use this tool to write automated tests for 1058Emacs Lisp developers can use this tool to write automated tests for
1057their code. See the ERT info manual for details. 1059their code. See the ERT info manual for details.