0.8.12.11:
authorChristophe Rhodes <csr21@cam.ac.uk>
Tue, 29 Jun 2004 13:25:02 +0000 (13:25 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Tue, 29 Jun 2004 13:25:02 +0000 (13:25 +0000)
Fix bug #340
... SETF of VALUES now works as per spec (CLHS 5.1.2.3)

BUGS
NEWS
src/code/late-setf.lisp
tests/setf.impure.lisp
version.lisp-expr

diff --git a/BUGS b/BUGS
index 51587c4..9d23422 100644 (file)
--- a/BUGS
+++ b/BUGS
@@ -1579,11 +1579,4 @@ WORKAROUND:
   qualifier patterns.
 
 340: SETF of VALUES using too many values
-  (reported by Kalle Olavi Niemetalo via the Debian bug system, with
-  bug id #256764)
-
-    (let ((a t) (b t) (c t) (d t))
-      (setf (values (values a b) (values c d)) (values 1 2 3 4))
-      (list a b c d))
-  should return (1 NIL 2 NIL), but under sbcl-0.8.12.x returns 
-  (1 2 3 4) instead.
+  (fixed in sbcl-0.8.12.10)
diff --git a/NEWS b/NEWS
index 9844abc..f703c4a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2554,14 +2554,14 @@ changes in sbcl-0.8.12 relative to sbcl-0.8.11:
     instances corresponding to C structs.
 
 changes in sbcl-0.8.13 relative to sbcl-0.8.12:
+  * new feature: SB-PACKAGE-LOCKS. See the "Package Locks" section of
+    the manual for details; add :SB-PACKAGE-LOCKS in
+    customize-target-features.lisp to enable them.
   * minor incompatible change: as threatened around sbcl-0.8.0, the
     home package of MOP-related symbols is now SB-MOP, not SB-PCL.
     The symbols are also exported from SB-PCL for backwards
     compatibility, but more so than before SB-PCL should be treated as
     an implementation-internal package.
-  * new feature: SB-PACKAGE-LOCKS. See the fine manual for details,
-    add :SB-PACKAGE-LOCKS in customize-target-features.lisp to
-    enable them.
   * the SB-SPROF contrib now works on (most) non-x86 architectures.
     It is known as of this release not to work on the Alpha, however.
   * fixed bug #338: instances of EQL-SPECIFIER are now valid type
@@ -2569,6 +2569,9 @@ changes in sbcl-0.8.13 relative to sbcl-0.8.12:
   * fixed bug #333: CHECK-TYPE now ensures that the type error
     signalled, if any, has the right object to be accessed by
     TYPE-ERROR-DATUM.  (reported by Tony Martinez)
+  * fixed bug #340: SETF of VALUES obeys the specification in ANSI
+    5.1.2.3 for multiple-value place subforms.  (reported by Kalle
+    Olavi Niemetalo)
   * fixed a bug: #\Space (and other whitespace characters) are no
     longer considered to be macro characters in standard syntax by
     GET-MACRO-CHARACTER.
index f5f3a97..1d41c5c 100644 (file)
       (dolist (place places)
        (multiple-value-bind (dummies vals newval setter getter)
            (sb!xc:get-setf-expansion place env)
-         (setq all-dummies (append all-dummies dummies)
-               all-vals (append all-vals vals)
-               newvals (append newvals newval))
+         ;; ANSI 5.1.2.3 explains this logic quite precisely.  --
+         ;; CSR, 2004-06-29
+         (setq all-dummies (append all-dummies dummies (cdr newval))
+               all-vals (append all-vals vals
+                                (mapcar (constantly nil) (cdr newval)))
+               newvals (append newvals (list (car newval))))
          (setters setter)
          (getters getter)))
       (values all-dummies all-vals newvals
index bc4f011..a7d29a0 100644 (file)
   (shiftf (values (car x) (car y)) (values (car y) (car x)))
   (assert (equal (list x y) '((2) (1)))))
 
+;;; SETF of values with multiple-value place forms
+(let ((a t) (b t) (c t) (d t))
+  (let ((list (multiple-value-list
+              (setf (values (values a b) (values c d)) (values 1 2 3 4)))))
+    (assert (equal list '(1 2)))
+    (assert (eql a 1))
+    (assert (eql c 2))
+    (assert (null b))
+    (assert (null d))))
+
 ;;; success
 (quit :unix-status 104)
index fb09481..8480117 100644 (file)
@@ -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.12.10"
+"0.8.12.11"