From: Alexey Dejneka Date: Mon, 21 Oct 2002 05:37:46 +0000 (+0000) Subject: 0.7.8.51: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=ebc5e12a9792f2e53cf5561c249236dae4501ef4;p=sbcl.git 0.7.8.51: Dirty workaround of FLOAT-RADIX not checking its argument type. --- diff --git a/src/code/float.lisp b/src/code/float.lisp index cc2b750..4f411f2 100644 --- a/src/code/float.lisp +++ b/src/code/float.lisp @@ -310,15 +310,17 @@ #!+long-float ((long-float) sb!vm:long-float-digits))) -(defun float-radix (x) - #!+sb-doc - "Return (as an integer) the radix b of its floating-point argument." - ;; ANSI says this function "should signal an error if [..] argument - ;; is not a float". Since X is otherwise ignored, Python doesn't - ;; check the type by default, so we have to do it ourself: - (unless (floatp x) - (error 'type-error :datum x :expected-type 'float)) - 2) +(setf (fdefinition 'float-radix) + ;; FIXME: Python flushes unused variable X in CLAMBDA, then + ;; flushes unused reference to X in XEP together with type + ;; check. When this is fixed, rewrite this definition in an + ;; ordinary form. -- APD, 2002-10-21 + (lambda (x) + #!+sb-doc + "Return (as an integer) the radix b of its floating-point argument." + (unless (floatp x) + (error 'type-error :datum x :expected-type 'float)) + 2)) ;;;; INTEGER-DECODE-FLOAT and DECODE-FLOAT diff --git a/tests/float.pure.lisp b/tests/float.pure.lisp index 1b17334..d287b4a 100644 --- a/tests/float.pure.lisp +++ b/tests/float.pure.lisp @@ -48,3 +48,7 @@ ;;; reported a fix for CMU CL, which was ported to sbcl-0.6.12.35.) (assert (typep (nth-value 1 (ignore-errors (float-radix "notfloat"))) 'type-error)) + +(assert (typep (nth-value 1 (ignore-errors + (funcall (fdefinition 'float-radix) "notfloat"))) + 'type-error)) diff --git a/version.lisp-expr b/version.lisp-expr index 458143e..3443d48 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.8.50" +"0.7.8.51"