Can someine please explain me the following piece of code? I understand what every small piece does, but can't seem to understand how they all work together The function is getting a list such as:
(1 2 (3 (4 5) (6 7)) 8 (9 10))
which has 5 sublists and it returns the list of all sublists:
((1 2 (3 (4 5) (6 7)) 8 (9 10)) (3 (4 5) (6 7)) (4 5) (6 7) (9 10))
The code is:
(defun all_sublists (l)
(cond
((atom l) nil)
(T (apply 'append (list l) (mapcar 'all_sublists l)))
)
)
i understand that first cond says if l is an atom return nil, but can you please explain me what does the second line? Why is there that T which i understand means True, and can you explain it to me as simple as possible?