RosettaCodeData/Task/Flatten-a-list/Common-Lisp/flatten-a-list-1.lisp
2023-07-01 13:44:08 -04:00

4 lines
145 B
Common Lisp

(defun flatten (structure)
(cond ((null structure) nil)
((atom structure) (list structure))
(t (mapcan #'flatten structure))))