aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2000-12-28 12:16:03 +0000
committerKenichi Handa2000-12-28 12:16:03 +0000
commit3aac3bcfdb79ab81736a9642ed27ac8cee6dd3c3 (patch)
treef96b786bd11fa9b1b43972289e3da859b9ffbf75
parent1c1c65de36652e5ea0dcec9f7b37d0dc7eeb035c (diff)
downloademacs-3aac3bcfdb79ab81736a9642ed27ac8cee6dd3c3.tar.gz
emacs-3aac3bcfdb79ab81736a9642ed27ac8cee6dd3c3.zip
(butlast, nbutlast): Moved to subr.el.
-rw-r--r--lisp/emacs-lisp/cl.el14
1 files changed, 0 insertions, 14 deletions
diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el
index 0e8897db2f4..1b8bb838a8f 100644
--- a/lisp/emacs-lisp/cl.el
+++ b/lisp/emacs-lisp/cl.el
@@ -472,20 +472,6 @@ SEQ, this is like `mapcar'. With several, it is like the Common Lisp
472;; (while (consp (cdr x)) (pop x)) 472;; (while (consp (cdr x)) (pop x))
473;; x)) 473;; x))
474 474
475(defun butlast (x &optional n)
476 "Returns a copy of LIST with the last N elements removed."
477 (if (and n (<= n 0)) x
478 (nbutlast (copy-sequence x) n)))
479
480(defun nbutlast (x &optional n)
481 "Modifies LIST to remove the last N elements."
482 (let ((m (length x)))
483 (or n (setq n 1))
484 (and (< n m)
485 (progn
486 (if (> n 0) (setcdr (nthcdr (- (1- m) n) x) nil))
487 x))))
488
489(defun list* (arg &rest rest) ; See compiler macro in cl-macs.el 475(defun list* (arg &rest rest) ; See compiler macro in cl-macs.el
490 "Return a new list with specified args as elements, cons'd to last arg. 476 "Return a new list with specified args as elements, cons'd to last arg.
491Thus, `(list* A B C D)' is equivalent to `(nconc (list A B C) D)', or to 477Thus, `(list* A B C D)' is equivalent to `(nconc (list A B C) D)', or to