(define (class-name parameters)
(let ((super (new-part super-class-name some-parameters))
(self 'nil))
(let ((instance-variable init-value)
...)
(define (method parameter-list)
method-body)
...
(define (dispatch message)
(cond ((eqv? message 'selector) method)
...
(else (method-lookup super message))))
(set! self dispatch))
self)) |
| | A general template of a simulated class with inheritance.
|