Commit f9efebca authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(last*): Definition deleted.

parent 369fba5f
...@@ -499,16 +499,16 @@ SEQ, this is like `mapcar'. With several, it is like the Common Lisp ...@@ -499,16 +499,16 @@ SEQ, this is like `mapcar'. With several, it is like the Common Lisp
"Return the `cdr' of the `cdr' of the `cdr' of the `cdr' of X." "Return the `cdr' of the `cdr' of the `cdr' of the `cdr' of X."
(cdr (cdr (cdr (cdr x))))) (cdr (cdr (cdr (cdr x)))))
(defun last* (x &optional n) ;;(defun last* (x &optional n)
"Returns the last link in the list LIST. ;; "Returns the last link in the list LIST.
With optional argument N, returns Nth-to-last link (default 1)." ;;With optional argument N, returns Nth-to-last link (default 1)."
(if n ;; (if n
(let ((m 0) (p x)) ;; (let ((m 0) (p x))
(while (consp p) (incf m) (pop p)) ;; (while (consp p) (incf m) (pop p))
(if (<= n 0) p ;; (if (<= n 0) p
(if (< n m) (nthcdr (- m n) x) x))) ;; (if (< n m) (nthcdr (- m n) x) x)))
(while (consp (cdr x)) (pop x)) ;; (while (consp (cdr x)) (pop x))
x)) ;; x))
(defun butlast (x &optional n) (defun butlast (x &optional n)
"Returns a copy of LIST with the last N elements removed." "Returns a copy of LIST with the last N elements removed."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment