comparison lisp/subr.el @ 3842:1c2a46ea1f78

[xemacs-hg @ 2007-02-22 16:53:20 by stephent] Doc fixes 2007-02-21. <87k5yaku0s.fsf@uwakimon.sk.tsukuba.ac.jp>
author stephent
date Thu, 22 Feb 2007 16:53:27 +0000
parents db783273b399
children b4f4e0cc90f1
comparison
equal deleted inserted replaced
3841:5989b9bbb612 3842:1c2a46ea1f78
77 expression itself. The lambda expression may then be treated as a 77 expression itself. The lambda expression may then be treated as a
78 function, i.e., stored as the function value of a symbol, passed to 78 function, i.e., stored as the function value of a symbol, passed to
79 funcall or mapcar, etc. 79 funcall or mapcar, etc.
80 80
81 ARGS should take the same form as an argument list for a `defun'. 81 ARGS should take the same form as an argument list for a `defun'.
82 DOCSTRING is an optional documentation string. 82 Optional DOCSTRING is a documentation string.
83 If present, it should describe how to call the function. 83 If present, it should describe how to call the function. Docstrings are
84 But documentation strings are usually not useful in nameless functions. 84 rarely useful unless the lambda will be named, eg, using `fset'.
85 INTERACTIVE should be a call to the function `interactive', which see. 85 Optional INTERACTIVE should be a call to the function `interactive'.
86 It may also be omitted. 86 BODY should be a list of lisp expressions.
87 BODY should be a list of lisp expressions." 87
88 The byte-compiler treats lambda expressions specially. If the lambda
89 expression is syntactically a function to be called, it will be compiled
90 unless protected by `quote'. Conversely, quoting a lambda expression with
91 `function' hints to the byte-compiler that it should compile the expression.
92 \(The byte-compiler may or may not actually compile it; for example it will
93 never compile lambdas nested in a data structure: `'(#'(lambda (x) x))').
94
95 The byte-compiler will warn about common problems such as the form
96 `(fset 'f '(lambda (x) x))' (the lambda cannot be byte-compiled; probably
97 the programmer intended `#'', although leaving the lambda unquoted will
98 normally suffice), but in general is it the programmer's responsibility to
99 quote lambda expressions appropriately."
88 `(function (lambda ,@cdr))) 100 `(function (lambda ,@cdr)))
89 101
90 ;; FSF 21.2 has various basic macros here. We don't because they're either 102 ;; FSF 21.2 has various basic macros here. We don't because they're either
91 ;; in cl*.el (which we dump and hence is always available) or built-in. 103 ;; in cl*.el (which we dump and hence is always available) or built-in.
92 104