Hello people,i'm trying to define a function that takes a list as an argument and returns true if one of its elements is a list.
My function for some reason always returns nil.
I'm using the listp predicate whichs returns true if something is a list but so far i fail to make it work as i want.
I also tried this which also won't work:
Thank you in advance.
My function for some reason always returns nil.
I'm using the listp predicate whichs returns true if something is a list but so far i fail to make it work as i want.
(defun list-in-a-list? (lst)
(or (listp (car lst)) (listp (cdr lst))))
Shouldn't or return true if one of " (listp (car lst)) " or " (listp (cdr lst)) " is true?I also tried this which also won't work:
(defun list-in-a-list? (lst)
(if (listp (car lst))
(list-in-a-list? (cdr lst))))
Any advice is welcome.Thank you in advance.