]> git.eshelyaron.com Git - emacs.git/commitdiff
* emacs-lisp/cl-lib.el (cl-endp): Conform to CL's semantics.
authorLeo Liu <sdl.web@gmail.com>
Mon, 19 May 2014 16:08:40 +0000 (00:08 +0800)
committerLeo Liu <sdl.web@gmail.com>
Mon, 19 May 2014 16:08:40 +0000 (00:08 +0800)
lisp/ChangeLog
lisp/emacs-lisp/cl-lib.el

index abe240a5ea48ccf19bb23245404192733e770d81..733d060f453233bcd763a9184b6a3347c1ba5c2d 100644 (file)
@@ -1,3 +1,7 @@
+2014-05-19  Leo Liu  <sdl.web@gmail.com>
+
+       * emacs-lisp/cl-lib.el (cl-endp): Conform to CL's semantics.
+
 2014-05-18  Glenn Morris  <rgm@gnu.org>
 
        * loadup.el:
index 929e3dfb2f5f87480e4f8ad3aa46f176206d2f0c..9ca9459987fef42919ad2c0c4974ae49627a4142 100644 (file)
@@ -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.")