aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAla'a Mohammad Alawi <amalawi@gmail.com>2012-05-01 18:40:59 +0400
committerAla'a Mohammad Alawi <amalawi@gmail.com>2012-05-01 18:40:59 +0400
commit835fabdfbb7a6b982db2b741375e6bf9d409df78 (patch)
tree03b0db59ee55b932ad26ba009c57d0572cd99e8d
parent3a031d74293b2adc3849f63cf436dd47f2aab48f (diff)
downloadtl-who-835fabdfbb7a6b982db2b741375e6bf9d409df78.tar.gz
tl-who-835fabdfbb7a6b982db2b741375e6bf9d409df78.tar.bz2
tl-who-835fabdfbb7a6b982db2b741375e6bf9d409df78.zip
corrected a typo, and changed the implementation of extract declarations from using cl:do to using cl:loop
-rw-r--r--util.lisp16
1 files changed, 9 insertions, 7 deletions
diff --git a/util.lisp b/util.lisp
index ae34184..ecfb689 100644
--- a/util.lisp
+++ b/util.lisp
@@ -229,12 +229,14 @@ character set."
(escape-string string :test #'non-7bit-ascii-escape-char-p))
(defun extract-declarations (body)
- "Given a FORM, the declarations - if any - will be exctracted
+ "Given a FORM, the declarations - if any - will be extracted
from the head of the FORM, and will return two values the declarations,
and the remaining of FORM"
- (do ((sexp (first body) (first forms))
- (forms (rest body) (rest forms))
- (declarations nil))
- ((not (eq (first sexp) 'cl:declare))
- (values declarations (append (if (null sexp) sexp (list sexp)) forms)))
- (push sexp declarations)))
+ (loop for sexp = (first body) then (first forms)
+ for forms = (rest body) then (rest forms)
+ for declarations = nil
+ if (not (eq (first sexp) 'cl:declare))
+ do (return (values declarations
+ (append (if (null sexp) sexp (list sexp)) forms)))
+ else
+ do (push sexp declarations))) \ No newline at end of file