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 269b398..0b68b8d 100644 (file)
           #: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)
 
 ;;;--------------------------------------------------------------------------
                                 (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.