From: Ramakrishnan Muthukrishnan Date: Wed, 25 Aug 2010 19:35:33 +0000 (+0530) Subject: solution to 2.45 in Scheme X-Git-Url: https://git.rkrishnan.org/pf/content/en/components/com_hotproperty/css?a=commitdiff_plain;h=25f3e0a799db41bb13c2646d7f5018f751c7c870;p=sicp.git solution to 2.45 in Scheme --- diff --git a/src/sicp/ex2_45.scm b/src/sicp/ex2_45.scm new file mode 100644 index 0000000..87a950e --- /dev/null +++ b/src/sicp/ex2_45.scm @@ -0,0 +1,15 @@ +#lang scheme + +(require (planet soegaard/sicp:2:1/sicp)) + +(define (split f1 f2) + (lambda (painter n) + (if (= n 0) + painter + (let ((smaller ((split f1 f2) painter (- n 1)))) + (f1 painter (f2 smaller smaller)))))) + +(define right-split (split beside below)) +(define up-split (split below beside)) + + \ No newline at end of file