the listp function doesn't apply the full "list" rules.
(cons 1 ( cons 2 3 ))
Isn't a list as the definition goes:
* either an empty list (nil)
* or a cons cell that has a list for a cdr
altough listp yelds true to that "list"
So I'm writing a function that will do the full thing
(defun isList (list) (if (null list) t (if (not (consp list )) nil (and t (isList (cdr list))))))
This is correct for the following examples
(cons 1 ( cons 2 ( cons 3 ( cons 4 5 ))))
(cons 1 (cons 2 3))
(cons 1 ( cons 2 ( cons 3 ( cons 4 nil ))))
It seams ok. Is it?