I need a function which appends either lists and atoms into one list.
I've tried many variations on something like this:
- Code: Select all
(defun app-sym ( &rest lst)
(if (null lst) nil
(cond
((atom (car lst)) (append (list (car lst)) (app-sym (cdr lst))))
((listp (car lst)) (append (car lst) (app-sym (cdr lst)))))))
but it doesn't even compile or work.
Can anybody explain to me what are the limits of using &rest within body of function?
i found no answer in "Common Lisp HyperSpec".
I am using LispWorks.
Should I write a macro ??? Brrr.. it is still to difficult for me
A.
