From: Ramakrishnan Muthukrishnan Date: Mon, 7 Nov 2011 16:37:14 +0000 (+0530) Subject: minor bug fixes to 4.2 and 4.3 X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/file/URI:LIT:krugkidfnzsc4/frontends/cyclelanguage?a=commitdiff_plain;h=d39ae4e3d1f65a1714c45b23488202fd62dde274;p=sicp.git minor bug fixes to 4.2 and 4.3 --- diff --git a/src/sicp/ex4_2.rkt b/src/sicp/ex4_2.rkt index 91daa83..e197d4b 100644 --- a/src/sicp/ex4_2.rkt +++ b/src/sicp/ex4_2.rkt @@ -3,7 +3,7 @@ #| a. application? only checks whether the given expression is a pair. It assumes that the rest of - the built in language clauses are already handled. So this will upset all other classes like + the built in language clauses are already handled. So this will upset all other clauses like define, let where Louis's eval would think define is a procedure and would proceed to evaluate the operands, which is wrong. diff --git a/src/sicp/ex4_3.rkt b/src/sicp/ex4_3.rkt index bbbf9a8..3314c12 100644 --- a/src/sicp/ex4_3.rkt +++ b/src/sicp/ex4_3.rkt @@ -3,7 +3,7 @@ (define (eval exp env) (cond ((self-evaluating? exp) exp) ((variable? exp) (lookup-variable-value exp env)) - ((get (type exp)) ((get (type exp)) exp env)))) + ((type exp) ((get (type exp)) exp env)))) (define (type expr) (car expr)) @@ -17,4 +17,4 @@ - \ No newline at end of file +