Untitled
Anonymous
plain_text
01/27/2024 11:54 AM
504 B
98
Indexable
defun nod(tree k e)
(cond
((null arbore) nil)
((zerop k) (list e e))
(t (mapcar (lambda (subL) (nod subL (- k 1) e)) L))))
MAPCAR: A proper list must not end with A
I also tried
(defun tree (L x k e)
(cond
((null L) nil)
((= x k) e)
(t (mapcar #'(lambda (v) (tree v (+ 1 x) k e)) L))))
(print (tree '(a (b (c d)) (e (f (h)))) 0 2 'm))Editor is loading...
Leave a Comment