Object-oriented programming in Scheme - slide 6 : 11 |
(define (class-name construction-parameters) (let ((instance-var init-value) ...) (define (method parameter-list) method-body) ... (define (self message) (cond ((eqv? message selector) method) ... (else (error "Undefined message" message)))) self))