Christophe Weblog Wiki Code Publications Music
test case!
authorChristophe Rhodes <csr21@cantab.net>
Thu, 12 Dec 2013 14:54:28 +0000 (14:54 +0000)
committerChristophe Rhodes <csr21@cantab.net>
Thu, 12 Dec 2013 14:54:28 +0000 (14:54 +0000)
Include some assertions on the behaviour of WALK

cons-specializer.lisp

index 0c834f20958bd1f8af5899bb924b0d7c6b79dfd7..c0ec716a3d51f8c0aeb82aab703836d3aaeffce9 100644 (file)
      (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))))))