blob: a92010a8253a3e2b725dc4dc59b9f5654e2a1775 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
(defun proper-list-p (object)
(when (listp object)
(do ((fast object (cddr fast))
(slow object (cdr slow)))
(nil)
(when (atom fast)
(return (null fast)))
(when (atom (cdr fast))
(return (null (cdr fast))))
(when (and (eq fast slow) (not (eq fast object)))
(return nil)))))
|