Created
August 13, 2013 07:36
-
-
Save yakreved/6218727 to your computer and use it in GitHub Desktop.
sicp 2.7
Программа Лизы неполна, поскольку она не определила, как реализуется абстракция
интервала. Вот определение конструктора интервала:
(define (make-interval a b) (cons a b))
Завершите реализацию, определив селекторы upper-bound и lower-bound.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (make-interval a b) (cons a b)) | |
(define (upper-bound x) (car x)) | |
(define (lower-bound x) (cdr x)) | |
(upper-bound (make-interval 4 5)) | |
(lower-bound (make-interval 4 5)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment