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

(last): New function.

parent d370591d
...@@ -78,6 +78,13 @@ BODY should be a list of lisp expressions." ...@@ -78,6 +78,13 @@ BODY should be a list of lisp expressions."
(defsubst cddr (x) (defsubst cddr (x)
"Return the cdr of the cdr of X." "Return the cdr of the cdr of X."
(cdr (cdr x))) (cdr (cdr x)))
(defun last (x)
"Return the last element of the list X.
If X is nil, return nil."
(while (cdr x)
(setq x (cdr x)))
x)
;;;; Keymap support. ;;;; Keymap support.
......
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