From: Alexey D. <ade...@co...> - 2002-11-20 11:49:36
|
Raymond Toy <to...@rt...> writes: > While trying to steal dolist from sbcl, I noticed a small possible bug > in dolist. > > (dolist (var list) > "docstring" > (other stuff)) > > The macro expansion of this silently eats the docstring instead of > leaving it around. (Well, it does when I use the defmacro from SBCL > and load it into CMUCL.) In 0.7.9.53+: * (macroexpand-1 '(dolist (i '(a b c)) "alala" (pum))) (DO* ((#:G1964 '(A B C) (CDR #:G1964))) ((ENDP #:G1964) NIL) (LET ((I (CAR #:G1964))) (TAGBODY "alala" (PUM)))) T * (dolist (i '(a b c)) "alala" (pum)) ; in: LAMBDA NIL ; (TAGBODY "alala" (PUM)) ; ; caught ERROR: ; "alala" is not a legal tagbody statement. > If the parse-body in SBCL works the same as CMUCL, then I think the > parse-body in dolist needs an extra NIL arg to say no docstrings > allowed. In src/code/defboot.lisp, v. 1.27: (defmacro-mundanely dolist ((var list &optional (result nil)) &body body) ;; [comments] (multiple-value-bind (forms decls) (parse-body body nil) ^^^ -- Regards, Alexey Dejneka |