From: Kevin Rosenberg Date: Sun, 20 Apr 2003 06:12:51 +0000 (+0000) Subject: 0.pre8.80 X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=53602259ee287a26112095878f43e2ff12487fa5;p=sbcl.git 0.pre8.80 - fix inspector bug when display with positive skip value and no elements --- diff --git a/contrib/sb-aclrepl/aclrepl-tests.lisp b/contrib/sb-aclrepl/aclrepl-tests.lisp index 154936a..602af92 100644 --- a/contrib/sb-aclrepl/aclrepl-tests.lisp +++ b/contrib/sb-aclrepl/aclrepl-tests.lisp @@ -259,17 +259,12 @@ (deftest tiny.double.0 (elements-count *double*) 0) -(deftest tiny.double.skip1.0 (elements-count *double* nil 1) 1) -(deftest tiny.double.skip1.1 (elements *double* nil 1) - #(nil)) +(deftest tiny.double.skip1.0 (elements-count *double* nil 1) 0) +(deftest tiny.double.skip1.1 (elements *double* nil 0) + nil) (deftest tiny.doubel.skip1.2 (elements-labels *double* nil 1) - #(:ellipses)) + nil) -(deftest tiny.double.skip2.0 (elements-count *double* nil 2) 1) -(deftest tiny.double.skip2.1 (elements *double* nil 2) - #(nil)) -(deftest tiny.double.skip2.2 (elements-labels *double* nil 2) - #(:ellipses)) (do-tests) diff --git a/contrib/sb-aclrepl/inspect.lisp b/contrib/sb-aclrepl/inspect.lisp index f127cad..807767c 100644 --- a/contrib/sb-aclrepl/inspect.lisp +++ b/contrib/sb-aclrepl/inspect.lisp @@ -452,21 +452,22 @@ and the last element." (first-to (if (first-element-ellipses-p parts skip) 1 0)) (elements (when (plusp element-count) (make-array element-count))) (labels (when (plusp element-count) (make-array element-count)))) - ;; possible first ellipses - (when (first-element-ellipses-p parts skip) - (set-element-values elements labels 0 nil :ellipses)) - ;; main elements - (do ((i 0 (1+ i))) - ((> i (- last-requested skip))) - (set-element elements labels parts (+ i first-to) (+ i skip))) - ;; last parts value if needed - (when (< last-requested last-part) - (set-element elements labels parts (- element-count 1) last-part)) - ;; ending ellipses or next to last parts value if needed - (when (< last-requested (1- last-part)) - (if (= last-requested (- last-part 2)) - (set-element elements labels parts (- element-count 2) (1- last-part)) - (set-element-values elements labels (- element-count 2) nil :ellipses))) + (when (plusp element-count) + ;; possible first ellipses + (when (first-element-ellipses-p parts skip) + (set-element-values elements labels 0 nil :ellipses)) + ;; main elements + (do* ((i 0 (1+ i))) + ((> i (- last-requested skip))) + (set-element elements labels parts (+ i first-to) (+ i skip))) + ;; last parts value if needed + (when (< last-requested last-part) + (set-element elements labels parts (- element-count 1) last-part)) + ;; ending ellipses or next to last parts value if needed + (when (< last-requested (1- last-part)) + (if (= last-requested (- last-part 2)) + (set-element elements labels parts (- element-count 2) (1- last-part)) + (set-element-values elements labels (- element-count 2) nil :ellipses)))) (values elements labels element-count))) (defun last-requested (parts print skip) @@ -477,8 +478,9 @@ and the last element." (defun compute-elements-count (parts length skip) "Compute the number of elements in parts given the print length and skip." - (let ((element-count (min length (max 0 (- (parts-count parts) skip))))) - (when (plusp skip) ; starting ellipses + (let ((element-count (min (parts-count parts) length + (max 0 (- (parts-count parts) skip))))) + (when (and (plusp (parts-count parts)) (plusp skip)) ; starting ellipses (incf element-count)) (when (< (last-requested parts length skip) (last-part parts)) ; last value diff --git a/version.lisp-expr b/version.lisp-expr index 9ecf95b..59756f4 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.pre8.79" +"0.pre8.80"