next up previous contents
Next: Class `author' Up: 3rd example of object Previous: Class `base-object-class'   Contents

Class `person'


(define make-person
  (lambda(aname)
    (define name aname)
    (define base-object (make-base-object))
;
    (define get-name
      (lambda()
        name))
;
    (define who-are-you
      (lambda()
        (print "error: method who-are-you not implemented")))
;
    (define self
      (lambda(msg)
        (if (equal msg 'get-name)
            name
            (if (equal msg 'who-are-you)
                who-are-you
                (base-object msg)))))
     self))



Georg P. Loczewski 2004-03-05


Impressum und Datenschutz