Solution exercises from P01 to P07

This commit is contained in:
Fabio Scotto di Santolo
2025-09-05 11:59:55 +02:00
commit 54214ae0aa
7 changed files with 64 additions and 0 deletions

10
p04.el Normal file
View File

@@ -0,0 +1,10 @@
;; 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