X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcode%2Ffloat.lisp;h=4f411f20c275999b44aa73b4e33fc3e53df6f87a;hb=5bf4a6a677c80a71dfa31b5c9c374f986594392f;hp=cc2b750968db13dd0c7d6612f5cc06c499c0a92a;hpb=8286d1fc02d1e769a766fbf1670bca474237161f;p=sbcl.git 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