0.7.8.51:
authorAlexey Dejneka <adejneka@comail.ru>
Mon, 21 Oct 2002 05:37:46 +0000 (05:37 +0000)
committerAlexey Dejneka <adejneka@comail.ru>
Mon, 21 Oct 2002 05:37:46 +0000 (05:37 +0000)
        Dirty workaround of FLOAT-RADIX not checking its argument
        type.

src/code/float.lisp
tests/float.pure.lisp
version.lisp-expr

index cc2b750..4f411f2 100644 (file)
     #!+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))
 \f
 ;;;; INTEGER-DECODE-FLOAT and DECODE-FLOAT
 
index 1b17334..d287b4a 100644 (file)
@@ -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))
index 458143e..3443d48 100644 (file)
@@ -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"