1.0.17.26: Fix regression in LOAD
authorRichard M Kreuter <kreuter@users.sourceforge.net>
Wed, 4 Jun 2008 18:50:26 +0000 (18:50 +0000)
committerRichard M Kreuter <kreuter@users.sourceforge.net>
Wed, 4 Jun 2008 18:50:26 +0000 (18:50 +0000)
* Between 1.0.16 and 1.0.17 LOAD began to return NIL when the argument
  had a non-NIL type and didn't name a file.  Fixed with tests.

* Additionally, writing the tests exposed an odd type restriction:
  LOAD's IF-DOES-NOT-EXIST argument was declared as having type
  (MEMBER :ERROR :CREATE NIL), but the CLHS just says it's a
  generalized boolean.

src/code/target-load.lisp
src/compiler/fndb.lisp
tests/load.pure.lisp
version.lisp-expr

index d1dcd87..b20c4e4 100644 (file)
                                      (open pathname
                                            :if-does-not-exist
                                            (if if-does-not-exist :error nil)
-                                           :element-type '(unsigned-byte 8)))
-                              (if if-does-not-exist
-                                  (error 'simple-file-error
-                                         :pathname pathspec
-                                         :format-control
-                                         "~@<Couldn't load ~S: file does not exist.~@:>"
-                                         :format-arguments (list pathspec))))))))
+                                           :element-type '(unsigned-byte 8))))))
+                      (if if-does-not-exist
+                          (error 'simple-file-error
+                                 :pathname pathspec
+                                 :format-control
+                                 "~@<Couldn't load ~S: file does not exist.~@:>"
+                                 :format-arguments (list pathspec)))))
         (unless stream
           (return-from load nil))
 
index 81fee12..5f8731d 100644 (file)
    &key
    (:verbose t)
    (:print t)
-   (:if-does-not-exist (member :error :create nil))
+   (:if-does-not-exist t)
    (:external-format keyword))
   t)
 
index 09ef251..eed5f45 100644 (file)
@@ -20,3 +20,8 @@
 (load "i-am-not.lisp" :if-does-not-exist nil)
 (load "i-am-not.fasl" :if-does-not-exist nil)
 (load "i-am-not.misc-garbage" :if-does-not-exist nil)
+
+;;; In 1.0.17, LOAD didn't error when the file didn't exist and
+;;; IF-DOES-NOT-EXIST was true.
+(assert (typep (nth-value 1 (ignore-errors (load "i-am-not"))) 'file-error))
+(assert (typep (nth-value 1 (ignore-errors (load "i-am-not" :if-does-not-exist t))) 'file-error))
index f37b0a1..82ec7ef 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".)
-"1.0.17.25"
+"1.0.17.26"