commit 5973190bb21a7deb3fafcdeb241156533fbeee0f
parent d2f199e6f3d38f9fe8324289600367df096f1f96
Author: Commit-Bot <unknown>
Date: Sat, 19 Jun 2010 05:47:25 +0000
Automatic commit from picoLisp.tgz, From: Sat, 19 Jun 2010 05:47:25 GMT
Diffstat:
2 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/doc/refA.html b/doc/refA.html
@@ -439,15 +439,15 @@ href="refM.html#mmeq">mmeq</a></code> and <a href="ref.html#cmp">Comparing</a>.
-> (b . 7)
</code></pre>
-<dt><a name="assert"><code>(assert exe) -> prg | NIL</code></a>
+<dt><a name="assert"><code>(assert exe ..) -> prg | NIL</code></a>
<dd>When in debug mode (<code><a href="refD.html#*Dbg">*Dbg</a></code> is
non-<code>NIL</code>), <code>assert</code> returns a <code>prg</code> list which
-tests <code>exe</code> and issues an error via <code><a
-href="refQ.html#quit">quit</a></code> if the result is <code>NIL</code>.
-Otherwise, <code>NIL</code> is returned. Used typically in combination with the
-<code>~</code> tilde <code><a href="ref.html#macro-io">read-macro</a></code> to
-insert the test code only when in debug mode. See also <code><a
-href="refT.html#test">test</a></code>.
+tests all <code>exe</code> conditions, and issues an error via <code><a
+href="refQ.html#quit">quit</a></code> if one of the results evaluates to
+<code>NIL</code>. Otherwise, <code>NIL</code> is returned. Used typically in
+combination with the <code>~</code> tilde <code><a
+href="ref.html#macro-io">read-macro</a></code> to insert the test code only when
+in debug mode. See also <code><a href="refT.html#test">test</a></code>.
<pre><code>
# Start in debug mode
diff --git a/lib/misc.l b/lib/misc.l
@@ -1,4 +1,4 @@
-# 18jun10abu
+# 19jun10abu
# (c) Software Lab. Alexander Burger
# *Allow *Tmp
@@ -477,11 +477,12 @@
(pre? "250 " (in S (line T))) )
### Assertions ###
-(de assert E
+(de assert Prg
(when *Dbg
(cons
- (list 'unless (car E)
- (list 'quit "'assert' failed" (lit (car E))) ) ) ) )
+ (list 'unless
+ (if (cdr Prg) (cons 'and Prg) (car Prg))
+ (list 'quit "'assert' failed" (lit (car Prg))) ) ) ) )
(de test (Pat . Prg)
(bind (fish pat? Pat)