From: Nikodemus Siivola Date: Sat, 11 Sep 2004 12:54:25 +0000 (+0000) Subject: 0.8.14.10: quoth the FORMAT, LOOP for on! X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=b1c7011c1f5d50b9821c07db75b1d5c3c6881062;p=sbcl.git 0.8.14.10: quoth the FORMAT, LOOP for on! * Merge FORMAT and LOOP patches by Julian Squires and Teemu Kalvas respectively, plus test-cases. --- diff --git a/NEWS b/NEWS index eb417ce..54d76b0 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,11 @@ changes in sbcl-0.8.15 relative to sbcl-0.8.14: * new feature: saving cores with foreign code loaded is now supported on x86/FreeBSD, x86/Linux, and sparc/SunOS. (based on Timothy Moore's work for CMUCL) + * bug fix: FOR ... ON ... -clauses in LOOP now work on dotted lists + (thanks for Teemu Kalvas) + * bug fix: in FORMAT ~^ inside ~:{ now correctly steps to the next + case instead of terminating the iteration (thanks for Julian Squires, + Sean Champ and Raymond Toy) * bug fix: incorrect expansion of defgeneric that caused a style warning. (thanks for Zach Beane) diff --git a/src/code/loop.lisp b/src/code/loop.lisp index 674c701..a02038c 100644 --- a/src/code/loop.lisp +++ b/src/code/loop.lisp @@ -1495,7 +1495,7 @@ code to be loaded. (let ((listvar var)) (cond ((and var (symbolp var)) (loop-make-iteration-var var list data-type)) - (t (loop-make-var (setq listvar (gensym)) list 'list) + (t (loop-make-var (setq listvar (gensym)) list 't) (loop-make-iteration-var var nil data-type))) (let ((list-step (loop-list-step listvar))) (let* ((first-endtest diff --git a/src/code/target-format.lisp b/src/code/target-format.lisp index e3c4475..f03d70f 100644 --- a/src/code/target-format.lisp +++ b/src/code/target-format.lisp @@ -1022,8 +1022,8 @@ (*logical-block-popper* nil) (*outside-args* args)) (catch 'up-and-out - (do-guts arg arg) - args)) + (do-guts arg arg)) + args) (do-guts orig-args args))) (do-loop (orig-args args) (catch (if colonp 'up-up-and-out 'up-and-out) diff --git a/tests/loop.pure.lisp b/tests/loop.pure.lisp index 408d18b..8f7b8dd 100644 --- a/tests/loop.pure.lisp +++ b/tests/loop.pure.lisp @@ -224,3 +224,8 @@ (y (list nil 2 nil))) (declare (special x y)) (assert (= (funcall fn) 2)))) + +;;; Incorrect LIST type declaration, reported and patched by Teemu +;;; Kalvas: end testing is done "as if by atom" so this is supposed +;;; to work. +(assert (equal '(1 2) (loop for (a . b) on '(1 2 . 3) collect a))) diff --git a/tests/print.impure.lisp b/tests/print.impure.lisp index e3184bc..7ce3498 100644 --- a/tests/print.impure.lisp +++ b/tests/print.impure.lisp @@ -247,5 +247,9 @@ (assert (string= (princ-to-string #\7) (write-to-string #\7 :escape nil :readably nil)))) +;;; in FORMAT, ~^ inside ~:{ should go to the next case, not break +;;; iteration, even if one argument is just a one-element list. +(assert (string= (format nil "~:{~A~^~}" '((A) (C D))) "AC")) + ;;; success (quit :unix-status 104) diff --git a/version.lisp-expr b/version.lisp-expr index 56c5052..3da2fce 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.8.14.9" +"0.8.14.10"