class-template-functions.scm - Accompanying functions for instantiation and message passing. | Lecture 8 - slide 6 : 11 Program 1 |
(define (new-instance class . parameters) (apply class parameters)) (define (send message object . args) (let ((method (object message))) (cond ((procedure? method) (apply method args)) (else (error "Error in method lookup " method)))))