summaryrefslogtreecommitdiff
path: root/lisp/subr.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-01-08 06:09:02 +0000
committerRichard M. Stallman <rms@gnu.org>1997-01-08 06:09:02 +0000
commit6d627fec21dde6c800121d6f0e70b16ab4a7989d (patch)
tree706ae0de62f0225a80b1bf46c52de7aa74533180 /lisp/subr.el
parent7936cf862a91a73d1d212582e16a0721edbe207d (diff)
downloademacs-6d627fec21dde6c800121d6f0e70b16ab4a7989d.tar.gz
(when, unless): Definitions moved from cl.el.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r--lisp/subr.el16
1 files changed, 6 insertions, 10 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index 22056046416..b674f364e46 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -43,17 +43,13 @@ BODY should be a list of lisp expressions."
;; depend on backquote.el.
(list 'function (cons 'lambda cdr)))
-;;(defmacro defun-inline (name args &rest body)
-;; "Create an \"inline defun\" (actually a macro).
-;;Use just like `defun'."
-;; (nconc (list 'defmacro name '(&rest args))
-;; (if (stringp (car body))
-;; (prog1 (list (car body))
-;; (setq body (or (cdr body) body))))
-;; (list (list 'cons (list 'quote
-;; (cons 'lambda (cons args body)))
-;; 'args))))
+(defmacro when (cond &rest body)
+ "(when COND BODY...): if COND yields non-nil, do BODY, else return nil."
+ (list 'if cond (cons 'progn body)))
+(defmacro unless (cond &rest body)
+ "(unless COND BODY...): if COND yields nil, do BODY, else return nil."
+ (cons 'if (cons cond (cons nil body))))
;;;; Keymap support.