Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun searchlist(A L)
- (cond
- ((endp L) nil) ;; is it null?
- ((listp (car L)) (loop for x in car L ;; Is the first element a list?
- do (searchlist A x ))) ;; If it is, search each element
- ((atom (car L)) ;; is the first member an atom?
- (if (equal (car L) A)
- T ;; it's what i'm looking for!
- (loop for x in list ;; not what i'm looking for, check rest of list
- do (searchlist A x))))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement