From 3b849bc0116ea70f215ee6b2fbf354e862aaa9dd Mon Sep 17 00:00:00 2001 From: Philipp Marek Date: Sat, 27 Oct 2018 16:44:20 +0200 Subject: [PATCH] Avoid duplicate logic in WHEN-LET* By using an explicit PROGN we can interpolate straight into the LET. The PROGN shouldn't matter, as the WHEN interferes with DECLAREs anyway. --- binding.lisp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/binding.lisp b/binding.lisp index 681623c..37a3d52 100644 --- a/binding.lisp +++ b/binding.lisp @@ -83,11 +83,8 @@ PROGN." bindings))) (labels ((bind (bindings body) (if bindings - `((let (,(car bindings)) - (when ,(caar bindings) - ,@(bind (cdr bindings) body)))) - body))) - `(let (,(car binding-list)) - (when ,(caar binding-list) - ,@(bind (cdr binding-list) body)))))) - + `(let (,(car bindings)) + (when ,(caar bindings) + ,(bind (cdr bindings) body))) + `(progn ,@body)))) + (bind binding-list body)))) -- GitLab