d2aa6ee9382a

Use switch instead of cond, it's cleaner
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Fri, 25 Mar 2016 11:49:46 +0000
parents 4b07fbd81ee2
children 14e794b02423
branches/tags (none)
files src/wam.lisp

Changes

--- a/src/wam.lisp	Fri Mar 25 11:49:06 2016 +0000
+++ b/src/wam.lisp	Fri Mar 25 11:49:46 2016 +0000
@@ -111,13 +111,15 @@
 
 ;;;; Heap
 (defun heap-debug (addr cell)
-  (cond
-    ((= +tag-reference+ (cell-type cell))
-     (if (= addr (cell-value cell))
-       "unbound variable"
-       "variable pointer"))
-    ((= +tag-functor+ (cell-type cell))
-     (format nil "functor/~D" (cell-functor-arity cell)))
+  (switch ((cell-type cell))
+    (+tag-reference+
+      (if (= addr (cell-value cell))
+        "unbound variable"
+        (format nil "var pointer to ~D" (cell-value cell))))
+    (+tag-functor+
+      (format nil "~A/~D"
+              (cell-functor-name cell)
+              (cell-functor-arity cell)))
     (t "")))
 
 (defun dump-heap (heap from to highlight)