From 28a4388d92ad924fcece5f171ad6cefbe5f2fc95 Mon Sep 17 00:00:00 2001 From: Joachim Kuebart Date: Mon, 4 Dec 2023 11:21:14 +0100 Subject: [PATCH 1/4] fix: add missing final line On the final line, eval must be called with two arguments: the expression and the association list. The final line is missing a closing parenthesis in the original document to match the initial opening parenthesis. This commit also adds a missing closing parenthesis on line 10. --- eval.lisp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eval.lisp b/eval.lisp index 336f6a0..e148a1a 100644 --- a/eval.lisp +++ b/eval.lisp @@ -73,4 +73,5 @@ a)) a))) ((eq (caar e) (quote label)) - (eval (cons (caddar e) (cdr e))) a))))) + (eval (cons (caddar e) (cdr e)) + (cons (cons (cadar e) (car e)) a)))))) From 0828b3e19508fdb89a2475c1bb0d4c943b112b68 Mon Sep 17 00:00:00 2001 From: Joachim Kuebart Date: Mon, 4 Dec 2023 19:42:43 +0100 Subject: [PATCH 2/4] fix: correct first assoc Add missing opening and closing parentheses on line 9. Add missing closing parenthesis on line 10. --- eval.lisp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eval.lisp b/eval.lisp index e148a1a..3caaeb8 100644 --- a/eval.lisp +++ b/eval.lisp @@ -6,8 +6,8 @@ (t (cdr ((label assoc (lambda (e a) (cond ((null a) nil) - ((eq e caar a)) (car a) - (t (assoc e (cdr a))))) + ((eq e (caar a)) (car a)) + (t (assoc e (cdr a)))))) e a))))) ((atom (car e)) From 33861acd22b4681a804d62c9d0a8be1b97bdf0a7 Mon Sep 17 00:00:00 2001 From: Joachim Kuebart Date: Mon, 4 Dec 2023 19:45:15 +0100 Subject: [PATCH 3/4] fix: add missing argument in call to pairup --- eval.lisp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eval.lisp b/eval.lisp index 3caaeb8..231b97e 100644 --- a/eval.lisp +++ b/eval.lisp @@ -63,7 +63,7 @@ (cond ((null u) nil) (t (cons (cons (car u) (car v)) (pairup (cdr u) (cdr v))))))) - + (cadar e) (label evlis (lambda (u a) (cond ((null u) nil) From 2abaebdf682fd191f8d10ab67ccadcf05952ced5 Mon Sep 17 00:00:00 2001 From: Joachim Kuebart Date: Mon, 4 Dec 2023 19:46:13 +0100 Subject: [PATCH 4/4] fix: correct evcond and evlis Remove extra opening parenthesis in evcond, line 41. Add missing opening parenthesis in evlis, line 67. --- eval.lisp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eval.lisp b/eval.lisp index 231b97e..24543b2 100644 --- a/eval.lisp +++ b/eval.lisp @@ -38,7 +38,7 @@ ((label evcond (lambda (u a) (cond ((eval (caar u) a) - ((eval (cadar u) a)) + (eval (cadar u) a)) (t (evcond (cdr u) a))))) (cdr e) a)) (t (eval (cons (cdr ((label assoc @@ -64,7 +64,7 @@ (t (cons (cons (car u) (car v)) (pairup (cdr u) (cdr v))))))) (cadar e) - (label evlis + ((label evlis (lambda (u a) (cond ((null u) nil) (t (cons (eval (car u) a)