-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Style warning in SBCL (unused variable) using DOPLIST #65
Comments
filipencopav
changed the title
Style warning in SBCL (unused variable) using DOPLIST (SBCL issue?)
Style warning in SBCL (unused variable) using DOPLIST
Feb 17, 2022
Found that a variable for holding the rest of the list is created in (defmacro doplist ((key val plist &optional rez) &body body)
"Like DOLIST but iterate over 2 items of the PLIST at once,
onsidered KEY and VAL. Asserts proper PLIST."
(once-only (plist)
(with-gensyms (tail)
`(progn
(do ((,tail ,plist (cddr ,tail)))
((null ,tail) ,rez)
(destructuring-bind (,key ,val &rest ,(gensym)) ,tail
; ^
; |
; here
,@body)))))) (defmacro doplist ((key val plist &optional rez) &body body)
"Like DOLIST but iterate over 2 items of the PLIST at once,
onsidered KEY and VAL. Asserts proper PLIST."
(rtl:once-only (plist)
(rtl:with-gensyms (tail)
`(progn
(do ((,tail ,plist (cddr ,tail)))
((null ,tail) ,rez)
(let ((,key (first ,tail))
(,val (second ,tail)))
,@body)))))) |
We only need to add |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code to reproduce:
Warning:
The text was updated successfully, but these errors were encountered: