From: William Harold Newman <wnewman@us...> - 2002-10-22 13:26:14
Update of /cvsroot/sbcl/sbcl/src/code
In directory usw-pr-cvs1:/tmp/cvs-serv22727/src/code
new BUGS entry
added draft of LIST-LENGTH-OR-DIE (commented out) since I was
at one point thinking of actually addressing CSR's
point about sequence function arg checking
RCS file: /cvsroot/sbcl/sbcl/src/code/late-extensions.lisp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- late-extensions.lisp 2 Sep 2001 17:28:33 -0000 1.8
+++ late-extensions.lisp 22 Oct 2002 13:26:11 -0000 1.9
@@ -19,3 +19,19 @@
;;; not improper and which is not circular?
(defun list-with-length-p (x)
(values (ignore-errors (list-length x))))
+;;; not used in 0.7.8, but possibly useful for defensive programming
+;;; in e.g. (COERCE ... 'VECTOR)
+;;;(defun list-length-or-die (x)
+;;; (or (list-length x)
+;;; ;; not clear how to do this best:
+;;; ;; * Should this be a TYPE-ERROR? Colloquially that'd make
+;;; ;; lots of sense, but since I'm not sure how to express
+;;; ;; "noncircular list" as a Lisp type expression, coding
+;;; ;; it seems awkward.
+;;; ;; * Should the ERROR object include the offending value?
+;;; ;; Ordinarily that's helpful, but if the user doesn't have
+;;; ;; his printer set up to deal with cyclicity, we might not
+;;; ;; be doing him a favor by printing the object here.
+;;; ;; -- WHN 2002-10-19
+;;; (error "can't calculate length of cyclic list")))