X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Flate-extensions.lisp;h=a841f908b461a8c2eac849e5ef59ac95401eeaa2;hb=9dfd024c6fe1337ae7b76f0fd68b8f3208a6c987;hp=4f1ffd0b52aea1e865e2dd2ab9b46022a6e1796d;hpb=959057baab99d4328fc386aee3fcc812f5fcb3ed;p=sbcl.git diff --git a/src/code/late-extensions.lisp b/src/code/late-extensions.lisp index 4f1ffd0..a841f90 100644 --- a/src/code/late-extensions.lisp +++ b/src/code/late-extensions.lisp @@ -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")))