Untitled
unknown
plain_text
2 years ago
376 B
3
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