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

11 lines
242 B
EmacsLisp

;; P04 (*) Find the number of element of a list
(defun my-length (lst)
(defun my-length-rec (lst res)
(cond
((eq lst '()) res)
(t
(my-length-rec (cdr lst) (+ 1 res)))))
(my-length-rec lst 0))
(my-length '(a b c)) ; 3