X-Git-Url: https://git.distorted.org.uk/~mdw/lisp/blobdiff_plain/38ccae7f2e8fdae39c9c3c2990b90c990a1489de..fe0f07ea19b36ce1abc1ec305d0203323cbf2316:/mdw-base.lisp diff --git a/mdw-base.lisp b/mdw-base.lisp index e87c511..73f85e7 100644 --- a/mdw-base.lisp +++ b/mdw-base.lisp @@ -28,7 +28,8 @@ (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 @@ -44,12 +45,19 @@ (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) "Define a function which can be used by macros during the compilation process." - `(eval-when (:compile-toplevel :load-toplevel) + `(eval-when (:compile-toplevel :load-toplevel :execute) (defun ,name ,args ,@body))) (defmacro show (x) @@ -111,7 +119,9 @@ (defun whitespace-char-p (ch) "Return whether CH is a whitespace character or not." (case ch - ((#\space #\tab #\newline #\return #\vt #\formfeed) t) + ((#\space #\tab #\newline #\return #\vt + #+cmu #\formfeed + #+clisp #\page) t) (t nil))) (declaim (ftype (function nil ()) slot-unitialized))