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

10 lines
198 B
EmacsLisp

;; P03 (*) Find the k'th element of a list
(defun element-at (lst k)
(cond
((eq lst '()) '())
((eq k 1) (car lst))
(t
(element-at (cdr lst) (- k 1)))))
(element-at '(a b c d) 3) ; c