mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-11-22 21:52:31 +03:00
Merge pull request #1045 from bcc32/patch-1
fix the while macro for Common Lisp
This commit is contained in:
commit
9dd6e173f7
@ -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:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user