0.9.10.5: correct CONSTANTP
authorNikodemus Siivola <nikodemus@random-state.net>
Mon, 27 Feb 2006 15:03:08 +0000 (15:03 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Mon, 27 Feb 2006 15:03:08 +0000 (15:03 +0000)
 * fix thinko in interactions between PROGV & IF and add a test to catch
    it.

src/compiler/constantp.lisp
tests/eval.impure.lisp
version.lisp-expr

index 41a69d6..721e594 100644 (file)
@@ -200,10 +200,13 @@ constantness of the FORM in ENVIRONMENT."
  (defconstantp progv (symbols values &body forms)
    :test (and (constantp* symbols)
               (constantp* values)
-              (let ((*special-constant-variables*
-                     (append (constant-form-value* symbols)
-                              *special-constant-variables*)))
-                (every #'constantp* forms)))
+              (let* ((symbol-values (constant-form-value* symbols))
+                     (*special-constant-variables*
+                      (append symbol-values *special-constant-variables*)))
+                (progv
+                    symbol-values
+                    (constant-form-value* values)
+                  (every #'constantp* forms))))
    :eval (progv
              (constant-form-value* symbols)
              (constant-form-value* values)
index 6b6293d..bf6141d 100644 (file)
                      '(x)
                      '(1)
                    (1+ x))              t         2)
-               ((unwind-protect 1 nil) t         1)
-               ((unwind-protect 1
-                  (xxx))               nil)
-               ((the integer 1)        t         1)
-               ((the integer (+ 1 1))  t         2)
-               ((the integer (foo))    nil)
+               ((progv '(x) '(t)
+                  (if x 1 2))          t         1)
+                ((unwind-protect 1 nil) t         1)
+                ((unwind-protect 1
+                   (xxx))               nil)
+                ((the integer 1)        t         1)
+                ((the integer (+ 1 1))  t         2)
+                ((the integer (foo))    nil)
                 ((+ 1 2)                t         3)))
   (destructuring-bind (form c &optional v) test
     (assert (eql (constantp form) c))
index a0cb646..6469097 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.9.10.4"
+"0.9.10.5"