Commit 50d66980 authored by Philipp Marek's avatar Philipp Marek

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

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