From 876c8f807e4e149b6ded2c029f3ddf69ecd1eb8a Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Sun, 2 Mar 2014 16:57:33 +0000 Subject: [PATCH] prettify walker slightly --- walker.lisp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/walker.lisp b/walker.lisp index 6e75518..38484ce 100644 --- a/walker.lisp +++ b/walker.lisp @@ -62,9 +62,12 @@ (dolist (form body) (walk form env (cons form call-stack)))))) (defmethod walk ((expr (cons let)) env call-stack) - (with-checked-bindings ((mapcar (lambda (x) (walk (cadr x) env (cons (cadr x) call-stack)) (cons (car x) (make-instance 'binding))) (cadr expr)) env call-stack) - (dolist (form (cddr expr)) - (walk form env (cons form call-stack))))) + (flet ((let-binding (x) + (walk (cadr x) env (cons (cadr x) call-stack)) + (cons (car x) (make-instance 'binding)))) + (with-checked-bindings ((mapcar #'let-binding (cadr expr)) env call-stack) + (dolist (form (cddr expr)) + (walk form env (cons form call-stack)))))) (defun walk/case (expr env call-stack) (typecase expr -- 2.39.5