Here is the code:
- Code: Select all
((null x) nil)
((listp (car x)) (cons NIL (lin (car x))))
((atom (car x)) (cons (car x) (lin (cdr x))))
Also, if you figure out how to do it can you please tell me how to get each atom only once in the resulting list since I fear my approach on this last bit is a bit blunt.