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
p07.el Normal file
View File

@@ -0,0 +1,10 @@
;; P07 (**) Flatten a nested list structure.
(defun my-flatten (l)
(cond
((null l) nil)
((atom l) (list l))
(t
(append (my-flatten (car l))
(my-flatten (cdr l))))))
(my-flatten '(a (b (c d) e))) ; '(a b c d e)