~mdw
/
lisp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
623291d
)
base: New `until' macro does the obvious thing.
author
Mark Wooding
<mdw@distorted.org.uk>
Wed, 17 May 2006 18:40:14 +0000
(19:40 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Wed, 17 May 2006 18:40:14 +0000
(19:40 +0100)
mdw-base.lisp
patch
|
blob
|
blame
|
history
diff --git
a/mdw-base.lisp
b/mdw-base.lisp
index
37a3068
..
e87c511
100644
(file)
--- a/
mdw-base.lisp
+++ b/
mdw-base.lisp
@@
-33,7
+33,7
@@
#:stringify #:mappend #:listify #:fix-pair #:pairify #:parse-body
#:whitespace-char-p
#:slot-uninitialized
#: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
#:with-gensyms #:let*/gensyms #:with-places
#:locp #:locf #:ref #:with-locatives
#:update-place #:update-place-after
@@
-189,9
+189,11
@@
(defmacro while (cond &body body)
"If COND is false, evaluate to nil; otherwise evaluate BODY and try again."
(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'."
(compile-time-defun do-case2-like (kind vform clauses)
"Helper function for `case2' and `ecase2'."