diff options
author | Leo Liu <sdl.web@gmail.com> | 2014-05-20 00:08:40 +0800 |
---|---|---|
committer | Leo Liu <sdl.web@gmail.com> | 2014-05-20 00:08:40 +0800 |
commit | 427de5355f3c70e60ddc65324f1270d533fca0c2 (patch) | |
tree | be2292cea55b91f48095800b20fb0ced45648501 /lisp/emacs-lisp | |
parent | 8bb5971691aa57b9eda5993440316f6bd3d667d1 (diff) | |
download | emacs-427de5355f3c70e60ddc65324f1270d533fca0c2.tar.gz emacs-427de5355f3c70e60ddc65324f1270d533fca0c2.tar.bz2 emacs-427de5355f3c70e60ddc65324f1270d533fca0c2.zip |
* emacs-lisp/cl-lib.el (cl-endp): Conform to CL's semantics.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/cl-lib.el | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el index 929e3dfb2f5..9ca9459987f 100644 --- a/lisp/emacs-lisp/cl-lib.el +++ b/lisp/emacs-lisp/cl-lib.el @@ -358,7 +358,13 @@ SEQ, this is like `mapcar'. With several, it is like the Common Lisp (cl--defalias 'cl-first 'car) (cl--defalias 'cl-second 'cadr) (cl--defalias 'cl-rest 'cdr) -(cl--defalias 'cl-endp 'null) + +(defun cl-endp (x) + "Return true if X is the empty list; false if it is a cons. +Signal an error if X is not a list." + (if (listp x) + (null x) + (signal 'wrong-type-argument (list 'list x 'x)))) (cl--defalias 'cl-third 'cl-caddr "Return the third element of the list X.") (cl--defalias 'cl-fourth 'cl-cadddr "Return the fourth element of the list X.") |