From 14e7098332d03c1bf462b810589cd75579b9803b Mon Sep 17 00:00:00 2001 From: Ramakrishnan Muthukrishnan <vu3rdd@gmail.com> Date: Thu, 23 Dec 2010 19:25:31 +0530 Subject: [PATCH] solution to 2.87 --- src/sicp/ex2_87.rkt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/sicp/ex2_87.rkt diff --git a/src/sicp/ex2_87.rkt b/src/sicp/ex2_87.rkt new file mode 100644 index 0000000..5f503f5 --- /dev/null +++ b/src/sicp/ex2_87.rkt @@ -0,0 +1,16 @@ +#lang racket + +(put '=zero? '(polynomial) + (lambda (p) + (define (terms-=zero? terms) + (if (empty-termlist? terms) + #t + (let ((term (first-term terms))) + (let ((c (coeff term))) + (let ((type (type-tag c))) + (let ((zproc (get '=zero? (list type)))) + (if (zproc c) + (terms-=zero? (rest-terms terms)) + #f))))))) + + (terms-=zero? (term-list p)))) \ No newline at end of file -- 2.45.2