From f06d688ce6a5d48a10990838efe63e69ae6a7db6 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Thu, 12 Dec 2013 14:54:28 +0000 Subject: [PATCH] test case! Include some assertions on the behaviour of WALK --- cons-specializer.lisp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cons-specializer.lisp b/cons-specializer.lisp index 0c834f2..c0ec716 100644 --- a/cons-specializer.lisp +++ b/cons-specializer.lisp @@ -67,4 +67,10 @@ (cadr form)) (defmethod walk ((form (cons let))) (let ((bindings (cadr form))) - `(with-bindings ,bindings ,@(cddr form)))))) + `(with-bindings ,bindings ,@(mapcar #'walk (cddr form))))) + + (assert (equal (walk t) '(lookup t))) + (assert (equal (walk nil) '(lookup nil))) + (assert (equal (walk '(foo bar)) '(call (flookup foo) (list (lookup bar))))) + (assert (equal (walk '(quote bar)) 'bar)) + (assert (equal (walk '(let foo bar)) '(with-bindings foo (lookup bar)))))) -- 2.30.2