Begin Exercise 2.29
This commit is contained in:
parent
edf806a655
commit
29504b7294
@ -161,3 +161,22 @@ and upper bound."
|
|||||||
(if (null l)
|
(if (null l)
|
||||||
()
|
()
|
||||||
(append (deep-reverse (cdr l)) (list (car l)))))
|
(append (deep-reverse (cdr l)) (list (car l)))))
|
||||||
|
|
||||||
|
;; Exercise 2.29
|
||||||
|
(defun make-mobile (left right)
|
||||||
|
(list left right))
|
||||||
|
|
||||||
|
(defun left-branch (mobile)
|
||||||
|
(car mobile))
|
||||||
|
|
||||||
|
(defun right-branch (mobile)
|
||||||
|
(cdr mobile))
|
||||||
|
|
||||||
|
(defun make-branch (length structure)
|
||||||
|
(list length structure))
|
||||||
|
|
||||||
|
(defun branch-length (branch)
|
||||||
|
(car branch))
|
||||||
|
|
||||||
|
(defun branch-structure (branch)
|
||||||
|
(cdr branch))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user