A class y that inherits from x . | Lecture 8 - slide 11 : 11 Program 2 |
(define (y) (let ((super (new-part x)) (self 'nil)) (let ((y-state 2) ) (define (get-state) y-state) (define (set-self! object-part) (set! self object-part) (send 'set-self! super object-part)) (define (self message) (cond ((eqv? message 'get-state) get-state) ((eqv? message 'set-self!) set-self!) (else (method-lookup super message)))) self))) ; end y