[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Proposal for ENDP



Recall that ENDP is the newly-recommended predicate for testing for
the end of a list.  I propose the small change that ENDP take an optional
second argument, which is the list whose end you are checking for.
All this does is allow better error reporting:

(defun endp (thing &optional (list () listp))
  (cond ((consp thing) nil)
	((null thing) t)
	(listp (cerror :improperly-terminated-list
		       "The non-null atom ~S terminated the list ~S"
		       thing list)
	       t)
	(t (cerror :improperly-terminated-list
		   "The non-null atom ~S terminated a list"
		   thing))))
-------