Merge branch 'master' of git+ssh://metalzone.distorted.org.uk/~mdw/public-git/lisp
authorMark Wooding <mdw@distorted.org.uk>
Wed, 17 May 2006 19:25:30 +0000 (20:25 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 17 May 2006 19:25:30 +0000 (20:25 +0100)
* 'master' of git+ssh://metalzone.distorted.org.uk/~mdw/public-git/lisp:
  asdf: Provide more package information and dependencies.
  sys-base: Only use the extensions package from CMUCL.
  base: Export unsigned-fixnum as a handy type to have.
  mop: Use CMUCL's `mop' package instead of `pcl'.
  base: New `until' macro does the obvious thing.

mdw-base.lisp
mdw-mop.lisp
mdw.asd
sys-base.lisp

index 37a3068..c4c3e17 100644 (file)
 
 (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
           #:slot-uninitialized
-          #:nlet #:while #:case2 #:ecase2
+          #:nlet #:while #:until #:case2 #:ecase2
           #:with-gensyms #:let*/gensyms #:with-places
           #:locp #:locf #:ref #:with-locatives
           #:update-place #:update-place-after
 (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)
 
 (defmacro while (cond &body body)
   "If COND is false, evaluate to nil; otherwise evaluate BODY and try again."
-  `(loop
-     (unless ,cond (return))
-     ,@body))
+  `(loop (unless ,cond (return)) (progn ,@body)))
+
+(defmacro until (cond &body body)
+  "If COND is true, evaluate to nil; otherwise evaluate BODY and try again."
+  `(loop (when ,cond (return)) (progn ,@body)))
 
 (compile-time-defun do-case2-like (kind vform clauses)
   "Helper function for `case2' and `ecase2'."
index dc5eb87..51db744 100644 (file)
@@ -27,7 +27,7 @@
 ;;; Packages.
 
 (defpackage #:mdw.mop
-  (:use #:common-lisp #:mdw.base #+cmu #:pcl)
+  (:use #:common-lisp #:mdw.base #+cmu #:mop)
   (:export #:compatible-class
           #:copy-instance #:copy-instance-using-class
           #:initargs-for-effective-slot #:make-effective-slot
diff --git a/mdw.asd b/mdw.asd
index bd252ec..57c8b14 100644 (file)
--- a/mdw.asd
+++ b/mdw.asd
@@ -4,17 +4,21 @@
   (:use #:common-lisp #:asdf))
 (in-package #:mdw.asdf)
 
-(defsystem "mdw"
+(defsystem #:mdw
+  :description "Useful utilities"
+  :version "2.0.3"
+  :author "Mark Wooding <mdw@distorted.org.uk>"
   :components ((:file "mdw-base")
               (:file "anaphora")
               (:file "sys-base")
               (:file "factorial")
-              (:file "mdw-mop")
-              (:file "str")
-              (:file "collect")
-              (:file "unix")
-              (:file "safely")
+              (:file "mdw-mop" :depends-on ("mdw-base"))
+              (:file "str" :depends-on ("mdw-base"))
+              (:file "collect" :depends-on ("mdw-base"))
+              (:file "unix" :depends-on ("mdw-base" "collect"))
+              (:file "safely" :depends-on ("mdw-base" "unix"))
               (:file "infix")
-              (:file "infix-ext")
-              (:file "optparse"))
-  :serial t)
+              (:file "infix-ext" :depends-on ("mdw-base"
+                                              "infix"
+                                              "factorial"))
+              (:file "optparse" :depends-on ("mdw-base" "sys-base" "str"))))
index f5f8341..440facf 100644 (file)
 ;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 (defpackage #:mdw.runlisp
-  (:use #:common-lisp #:extensions)
+  (:use #:common-lisp #+cmu #:extensions)
   (:export #:*lisp-interpreter* #:*command-line-strings*))
 (defpackage #:mdw.sys-base
-  (:use #:common-lisp #:extensions #:mdw.runlisp)
+  (:use #:common-lisp #+cmu #:extensions #:mdw.runlisp)
   (:export #:exit #:hard-exit #:*program-name* #:*command-line-strings*))
 (in-package #:mdw.sys-base)