From: Ramakrishnan Muthukrishnan Date: Mon, 2 Jan 2012 15:51:40 +0000 (+0530) Subject: test for named let X-Git-Url: https://git.rkrishnan.org/zeppelin?a=commitdiff_plain;h=871a4a8e2869b365b7bde907ec5762426dabfba0;p=sicp.git test for named let --- diff --git a/src/sicp/metacircular2-test.rkt b/src/sicp/metacircular2-test.rkt index a4c23ea..91ea502 100644 --- a/src/sicp/metacircular2-test.rkt +++ b/src/sicp/metacircular2-test.rkt @@ -62,7 +62,16 @@ (even? x))) env1) (check-equal? (eval '(f1 2) env1) true "internal definitions") - (check-equal? (eval '(f1 3) env1) false "internal definitions")))) + (check-equal? (eval '(f1 3) env1) false "internal definitions") + (eval '(define (fib n) + (let fib-iter ((a 1) + (b 0) + (count n)) + (if (= count 0) + b + (fib-iter (+ a b) a (- count 1))))) + env1) + (check-equal? (eval '(fib 10) env1) 55 "named let")))) (run-tests metacircular2-tests) \ No newline at end of file