Named Objects |
|
(define (make-named-object name)
;; All objects deletegate to this, so we are
;; guaranteed that any object can respond to the
;; messages NAME, INSTALL, and SAY.
(lambda (message)
(case message
((NAMED-OBJECT?) (lambda (self) #T))
((NAME) (lambda (self) name))
((SAY)
(lambda (self list-of-stuff)
(if (not (null? list-of-stuff))
(display-message list-of-stuff))
'NUF-SAID))
((INSTALL) (lambda (self) 'INSTALLED))
(else (no-method))))))
| Jim Miller |