chiark / gitweb /
base: Provide fixnump function.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 30 Apr 2006 12:29:58 +0000 (13:29 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 30 Apr 2006 12:29:58 +0000 (13:29 +0100)
CMU CL already implements fixnump in the extensions package  Provide it
explicitly here anyway, for other implementations.

Quite why this function isn't in the Common Lisp spec anyway is still a
mystery.

mdw-base.lisp

index 269b398d22a8a34c34e838f2332f4ad3dfba0e12..0b68b8d69be12b4476f62c82ceb43c6e6217ef51 100644 (file)
@@ -37,7 +37,10 @@ (defpackage #:mdw.base
           #:with-gensyms #:let*/gensyms #:with-places
           #:locp #:locf #:ref #:with-locatives
           #:update-place #:update-place-after
-          #:incf-after #:decf-after))
+          #:incf-after #:decf-after
+          #:fixnump)
+  #+cmu (:import-from #:extensions #:fixnump))
+
 (in-package #:mdw.base)
 
 ;;;--------------------------------------------------------------------------
@@ -124,6 +127,13 @@ (compile-time-defun parse-body (body &key (allow-docstring-p t))
                                 (and decls (list (cons 'declare decls)))
                                 forms))))))))
 
+#-cmu
+(progn
+  (declaim (inline fixnump))
+  (defun fixnump (object)
+    "Answer non-nil if OBJECT is a fixnum, or nil if it isn't."
+    (typep object 'fixnum)))
+
 ;;;--------------------------------------------------------------------------
 ;;; Generating symbols.