![]()
(define (point x y) (let ((x x) (y y) );;; Accessors(define (getx) x) (define (gety) y) (define (add p) (point (+ x (send 'getx p)) (+ y (send 'gety p)))) (define (type-of) 'point ) (define (self message) (cond ((eqv? message 'getx) getx) ((eqv? message 'gety) gety) ((eqv? message 'add) add) ((eqv? message 'type-of) type-of) (else (error "Undefined message" message)))) self))![]()
(define (fac n) (if (= n 0) 1 (* n (fac (- n 1)))))