Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

corrected a typo, and changed the implementation of extract declarati…

…ons from using cl:do to using cl:loop
  • Loading branch information...
commit 835fabdfbb7a6b982db2b741375e6bf9d409df78 1 parent 3a031d7
@fighting-spirit fighting-spirit authored
Showing with 9 additions and 7 deletions.
  1. +9 −7 util.lisp
View
16 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)))
Please sign in to comment.
Something went wrong with that request. Please try again.