Alyssa's program is incomplete because she has not specified the implementation of the interval abstraction. Here is a definition of the interval constructor:
(define (make-interval a b) (cons a b))
Define selectors upper-bound and lower-bound to complete the implementation.
There are no comments yet.
You must log in to post a comment.Login
(define (make-interval a b) (cons a b)) (define lower 5) (define upper 10) (define interval (make-interval lower upper)) (check-equal? (lower-bound interval) lower) (check-equal? (upper-bound interval) upper)