comparison lisp/subr.el @ 19492:892a09772457

(last): New function.
author Richard M. Stallman <rms@gnu.org>
date Sat, 23 Aug 1997 19:10:42 +0000
parents f5fd22f3462c
children 17db1ee36bbb
comparison
equal deleted inserted replaced
19491:f5fd22f3462c 19492:892a09772457
76 (cdr (car x))) 76 (cdr (car x)))
77 77
78 (defsubst cddr (x) 78 (defsubst cddr (x)
79 "Return the cdr of the cdr of X." 79 "Return the cdr of the cdr of X."
80 (cdr (cdr x))) 80 (cdr (cdr x)))
81
82 (defun last (x)
83 "Return the last element of the list X.
84 If X is nil, return nil."
85 (while (cdr x)
86 (setq x (cdr x)))
87 x)
81 88
82 ;;;; Keymap support. 89 ;;;; Keymap support.
83 90
84 (defun undefined () 91 (defun undefined ()
85 (interactive) 92 (interactive)