Skip to content
Snippets Groups Projects
Commit 50d66980 authored by Philipp Marek's avatar Philipp Marek
Browse files

Revert "Avoid duplicate logic in WHEN-LET*."

This reverts commit 612700cd.
parent 408ff1d6
No related branches found
No related tags found
No related merge requests found
......@@ -79,13 +79,15 @@ Execution of WHEN-LET* stops immediately if any INITIAL-FORM evaluates to NIL.
If all INITIAL-FORMs evaluate to true, then BODY is executed as an implicit
PROGN."
(let ((binding-list (if (and (consp bindings) (symbolp (car bindings)))
(list bindings)
bindings)))
(list bindings)
bindings)))
(labels ((bind (bindings body)
(if bindings
`(let (,(car bindings))
(when ,(caar bindings)
(bind (cdr bindings) body)))
`(progn ,@body))))
(bind (cdr binding-list) body))))
`((let (,(car bindings))
(when ,(caar bindings)
,@(bind (cdr bindings) body))))
body)))
`(let (,(car binding-list))
(when ,(caar binding-list)
,@(bind (cdr binding-list) body))))))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment