base: Export unsigned-fixnum as a handy type to have.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 17 May 2006 18:48:05 +0000 (19:48 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 17 May 2006 19:06:55 +0000 (20:06 +0100)
mdw-base.lisp

index e87c511..c4c3e17 100644 (file)
@@ -28,7 +28,8 @@
 
 (defpackage #:mdw.base
   (:use #:common-lisp)
 
 (defpackage #:mdw.base
   (:use #:common-lisp)
-  (:export #:compile-time-defun
+  (:export #:unsigned-fixnum
+          #:compile-time-defun
           #:show
           #:stringify #:mappend #:listify #:fix-pair #:pairify #:parse-body
           #:whitespace-char-p
           #:show
           #:stringify #:mappend #:listify #:fix-pair #:pairify #:parse-body
           #:whitespace-char-p
 (in-package #:mdw.base)
 
 ;;;--------------------------------------------------------------------------
 (in-package #:mdw.base)
 
 ;;;--------------------------------------------------------------------------
+;;; Useful types.
+
+(deftype unsigned-fixnum ()
+  "Unsigned fixnums; useful as array indices and suchlike."
+  `(mod ,most-positive-fixnum))
+
+;;;--------------------------------------------------------------------------
 ;;; Some simple macros to get things going.
 
 (defmacro compile-time-defun (name args &body body)
 ;;; Some simple macros to get things going.
 
 (defmacro compile-time-defun (name args &body body)