Files
99_lisp_problems/p02.el
2025-09-05 11:59:55 +02:00

10 lines
203 B
EmacsLisp

;; P02 (*) Find the last but one box of a list
(defun my-but-last (lst)
(cond
((eq lst '()) '())
((eq (cddr lst) '()) lst)
(t
(my-but-last (cdr lst)))))
(my-but-last '(a b c d)) ; '(c d)