summaryrefslogtreecommitdiffhomepage
path: root/common-lisp.html.markdown
diff options
context:
space:
mode:
authorLevi Bostian <levi.bostian@gmail.com>2015-04-22 11:09:50 -0500
committerLevi Bostian <levi.bostian@gmail.com>2015-04-22 11:09:50 -0500
commit9dd6e173f711782ee2beb91a7ca69efde75fe6ae (patch)
treea04776e977ecdee22a74a731df087a11a849c81e /common-lisp.html.markdown
parent97ce4be0cd8092fbb5a3fe82b42b298b3463d5d2 (diff)
parent6b2d8d5fe2556316c6cff7f876153716ce296183 (diff)
Merge pull request #1045 from bcc32/patch-1
fix the while macro for Common Lisp
Diffstat (limited to 'common-lisp.html.markdown')
-rw-r--r--common-lisp.html.markdown8
1 files changed, 5 insertions, 3 deletions
diff --git a/common-lisp.html.markdown b/common-lisp.html.markdown
index c4ecb5e8..f9f64d68 100644
--- a/common-lisp.html.markdown
+++ b/common-lisp.html.markdown
@@ -573,13 +573,15 @@ nil ; for false - and the empty list
"While `condition` is true, `body` is executed.
`condition` is tested prior to each execution of `body`"
- (let ((block-name (gensym)))
+ (let ((block-name (gensym)) (done (gensym)))
`(tagbody
+ ,block-name
(unless ,condition
- (go ,block-name))
+ (go ,done))
(progn
,@body)
- ,block-name)))
+ (go ,block-name)
+ ,done)))
;; Let's look at the high-level version of this: