乐正

Actions speak louder than words.

Sicp-ex2-45

问题

可以将right-splitup-split表述为某种广义划分操作的实例。请定义一个过程split, 是它具有如下性质,求值:

1
2
3
(define right-split (split deside below))

(define up-split (split below beside))

产生能够出过程right-splitup-split,其行为与前面定义的过程一样。

解答

练习2.45 (ex2-45.scm) download
1
2
3
4
5
(define (split lf rt)
  (lambda (painter)
    (let ((left (lf painter))
          (right (rt painter)))
      (beside left right))))

draft

« sicp-ex2-44 sicp-ex2-46 »

Comments