From d844c38df29d4bc6a05b3a9c8535acddf803a5c0 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Sun, 14 Jul 2019 22:58:54 -0400 Subject: [PATCH] Troubleshoot negation Negation still doesn't seem to be working, although everything else looks good. --- src/sicp_logic/evaluator.clj | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sicp_logic/evaluator.clj b/src/sicp_logic/evaluator.clj index 68be48a..addee83 100644 --- a/src/sicp_logic/evaluator.clj +++ b/src/sicp_logic/evaluator.clj @@ -21,7 +21,7 @@ (defn negate [db operands input-frames] (filter (fn [frame] - (empty? (qeval db operands [frame]))) + (empty? (qeval db (first operands) [frame]))) input-frames)) (defn execute [exp] @@ -39,7 +39,8 @@ call frame (fn [v f] - (throw (IllegalArgumentException. (str "Unknown pattern variable -- LISP-VALUE: " v)))))) + (throw + (IllegalArgumentException. (str "Unknown pattern variable -- LISP-VALUE: " v)))))) [frame] [])) input-frames))