From: Mark Wooding Date: Wed, 17 May 2006 19:25:30 +0000 (+0100) Subject: Merge branch 'master' of git+ssh://metalzone.distorted.org.uk/~mdw/public-git/lisp X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/lisp/commitdiff_plain/a035dd4a8175317f19a35cd04568d1655fb8d417?hp=a8bbb2e72e8c8f9168520d92c7d8a01377928e91 Merge branch 'master' of git+ssh://metalzone.distorted.org.uk/~mdw/public-git/lisp * '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. --- diff --git a/mdw-base.lisp b/mdw-base.lisp index 37a3068..c4c3e17 100644 --- a/mdw-base.lisp +++ b/mdw-base.lisp @@ -28,12 +28,13 @@ (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 @@ -43,6 +44,13 @@ (defpackage #: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. @@ -189,9 +197,11 @@ (defmacro nlet (name binds &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'." diff --git a/mdw-mop.lisp b/mdw-mop.lisp index dc5eb87..51db744 100644 --- a/mdw-mop.lisp +++ b/mdw-mop.lisp @@ -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 --- 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 " :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")))) diff --git a/sys-base.lisp b/sys-base.lisp index f5f8341..440facf 100644 --- a/sys-base.lisp +++ b/sys-base.lisp @@ -24,10 +24,10 @@ ;;; 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)