From: Christophe Rhodes Date: Wed, 6 Nov 2002 09:59:28 +0000 (+0000) Subject: 0.7.9.33: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=da54f0f75754190f30f8585ff05bebd254aa4e40;p=sbcl.git 0.7.9.33: Make FUNCALL QUOTE signal an UNDEFINED-FUNCTION error, as required under the CLHS FUNCALL description ... detected by Paul Dietz' test suite --- diff --git a/BUGS b/BUGS index bbf6c30..336ebd9 100644 --- a/BUGS +++ b/BUGS @@ -382,6 +382,9 @@ WORKAROUND: LOAD-FOREIGN, and (2) hunt for any other code which uses temporary files and make it share the same new safe logic. + (partially alleviated in sbcl-0.7.9.32 by a fix by Matthew Danish to + make the temporary filename less easily guessable) + 82: Functions are assigned names based on the context in which they're defined. This is less than ideal for the functions which are @@ -795,14 +798,6 @@ WORKAROUND: macro is unhappy with the illegal syntax in the method body, and is giving an unclear error message. -172: - sbcl's treatment of at least macro lambda lists is too permissive; - e.g., in sbcl-0.7.3.7: - (defmacro foo (&rest rest bar) `(,bar ,rest)) - (macroexpand '(foo quux zot)) -> (QUUX (QUUX ZOT)) - whereas section 3.4.4 of the CLHS doesn't allow required parameters - to come after the rest argument. - 173: The compiler sometimes tries to constant-fold expressions before it checks to see whether they can be reached. This can lead to diff --git a/NEWS b/NEWS index 02bd302..660bcce 100644 --- a/NEWS +++ b/NEWS @@ -1362,7 +1362,7 @@ changes in sbcl-0.7.10 relative to sbcl-0.7.9: FORWARD-REFERENCED-CLASSes; error reporting on CLASS-DEFAULT-INITARGS, CLASS-PRECEDENCE-LIST and CLASS-SLOTS has been improved; - * fixed some bugs, shown by Paul Dietz' test suite: + * fixed some bugs shown by Paul Dietz' test suite: ** DOLIST puts its body in TAGBODY ** SET-EXCLUSIVE-OR sends arguments to :TEST function in the correct order @@ -1376,6 +1376,8 @@ changes in sbcl-0.7.10 relative to sbcl-0.7.9: is not a valid sequence index; ** LOOP signals (at macroexpansion time) an error of type PROGRAM-ERROR when duplicate variable names are found; + ** FUNCALL of special-operators now cause an error of type + UNDEFINED-FUNCTION; * fixed bug 166: compiler preserves "there is a way to go" invariant when deleting code. * fixed bug 172: macro lambda lists with required arguments after diff --git a/package-data-list.lisp-expr b/package-data-list.lisp-expr index b44e9f8..2882ecc 100644 --- a/package-data-list.lisp-expr +++ b/package-data-list.lisp-expr @@ -693,6 +693,7 @@ retained, possibly temporariliy, because it might be used internally." "SIMPLE-PARSE-ERROR" "SIMPLE-PROGRAM-ERROR" "SIMPLE-STREAM-ERROR" "SIMPLE-STYLE-WARNING" + "SPECIAL-FORM-FUNCTION" "STYLE-WARN" ;; bootstrapping magic, to make things happen both in diff --git a/src/code/condition.lisp b/src/code/condition.lisp index 428c7dd..d6cfa9d 100644 --- a/src/code/condition.lisp +++ b/src/code/condition.lisp @@ -604,6 +604,13 @@ "The function ~S is undefined." (cell-error-name condition))))) +(define-condition special-form-function (undefined-function) () + (:report + (lambda (condition stream) + (format stream + "Cannot FUNCALL the SYMBOL-FUNCTION of special operator ~S." + (cell-error-name condition))))) + (define-condition arithmetic-error (error) ((operation :reader arithmetic-error-operation :initarg :operation diff --git a/src/compiler/macros.lisp b/src/compiler/macros.lisp index 941cef4..97be928 100644 --- a/src/compiler/macros.lisp +++ b/src/compiler/macros.lisp @@ -78,8 +78,8 @@ `((setf (symbol-function ',name) (lambda (&rest rest) (declare (ignore rest)) - (error "can't FUNCALL the SYMBOL-FUNCTION of ~ - special forms"))))))))) + (error 'special-form-function + :name ',name))))))))) ;;; (This is similar to DEF-IR1-TRANSLATOR, except that we pass if the ;;; syntax is invalid.) diff --git a/tests/compiler.pure.lisp b/tests/compiler.pure.lisp index 704a693..a4e7476 100644 --- a/tests/compiler.pure.lisp +++ b/tests/compiler.pure.lisp @@ -234,3 +234,16 @@ ;;; FTYPE should accept any functional type specifier (compile nil '(lambda (x) (declare (ftype function f)) (f x))) + +;;; FUNCALL of special operators and macros should signal an +;;; UNDEFINED-FUNCTION error +(multiple-value-bind (result error) + (ignore-errors (funcall 'quote 1)) + (assert (null result)) + (assert (typep error 'undefined-function)) + (assert (eq (cell-error-name error) 'quote))) +(multiple-value-bind (result error) + (ignore-errors (funcall 'and 1)) + (assert (null result)) + (assert (typep error 'undefined-function)) + (assert (eq (cell-error-name error) 'and))) diff --git a/tests/loop.pure.lisp b/tests/loop.pure.lisp index 23f6691..222f418 100644 --- a/tests/loop.pure.lisp +++ b/tests/loop.pure.lisp @@ -63,4 +63,4 @@ (funcall (lambda () (loop for (a . a) in '((1 . 2) (3 . 4)) return a))))) - 'program-error)) \ No newline at end of file + 'program-error)) diff --git a/version.lisp-expr b/version.lisp-expr index ea30ceb..ac595bf 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -18,4 +18,4 @@ ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.7.9.32" +"0.7.9.33"