comparison lisp/prim/subr.el @ 177:6075d714658b r20-3b15

Import from CVS: tag r20-3b15
author cvs
date Mon, 13 Aug 2007 09:51:16 +0200
parents 929b76928fce
children b405438285a2
comparison
equal deleted inserted replaced
176:6866abce6aaf 177:6075d714658b
33 ;;; Code: 33 ;;; Code:
34 34
35 35
36 ;;;; Lisp language features. 36 ;;;; Lisp language features.
37 37
38 (defmacro lambda (&rest cdr) 38 ;; Moved to packages.el
39 "Return a lambda expression. 39 ;(defmacro lambda (&rest cdr)
40 A call of the form (lambda ARGS DOCSTRING INTERACTIVE BODY) is 40 ; "Return a lambda expression.
41 self-quoting; the result of evaluating the lambda expression is the 41 ;A call of the form (lambda ARGS DOCSTRING INTERACTIVE BODY) is
42 expression itself. The lambda expression may then be treated as a 42 ;self-quoting; the result of evaluating the lambda expression is the
43 function, i.e., stored as the function value of a symbol, passed to 43 ;expression itself. The lambda expression may then be treated as a
44 funcall or mapcar, etc. 44 ;function, i.e., stored as the function value of a symbol, passed to
45 45 ;funcall or mapcar, etc.
46 ARGS should take the same form as an argument list for a `defun'. 46
47 DOCSTRING is an optional documentation string. 47 ;ARGS should take the same form as an argument list for a `defun'.
48 If present, it should describe how to call the function. 48 ;DOCSTRING is an optional documentation string.
49 But documentation strings are usually not useful in nameless functions. 49 ; If present, it should describe how to call the function.
50 INTERACTIVE should be a call to the function `interactive', which see. 50 ; But documentation strings are usually not useful in nameless functions.
51 It may also be omitted. 51 ;INTERACTIVE should be a call to the function `interactive', which see.
52 BODY should be a list of lisp expressions." 52 ;It may also be omitted.
53 ;; Note that this definition should not use backquotes; subr.el should not 53 ;BODY should be a list of lisp expressions."
54 ;; depend on backquote.el. 54 ; ;; Note that this definition should not use backquotes; subr.el should not
55 ;; #### - I don't see why. So long as backquote.el doesn't use anything 55 ; ;; depend on backquote.el.
56 ;; from subr.el, there's no problem with using backquotes here. --Stig 56 ; ;; #### - I don't see why. So long as backquote.el doesn't use anything
57 ;;(list 'function (cons 'lambda cdr))) 57 ; ;; from subr.el, there's no problem with using backquotes here. --Stig
58 `(function (lambda ,@cdr))) 58 ; ;;(list 'function (cons 'lambda cdr)))
59 ; `(function (lambda ,@cdr)))
59 60
60 (defmacro defun-when-void (&rest args) 61 (defmacro defun-when-void (&rest args)
61 "Define a function, just like `defun', unless it's already defined. 62 "Define a function, just like `defun', unless it's already defined.
62 Used for compatibility among different emacs variants." 63 Used for compatibility among different emacs variants."
63 `(if (fboundp ',(car args)) 64 `(if (fboundp ',(car args))