next up previous contents
Next: 2nd example of object Up: Object Oriented Programming in Previous: Source code for constructor   Contents

Testing class `account'


(define konto
  (lambda()
    (define k1 (make-account ten))
    (define k2 (make-account five))
    (define msg-deposit two)
    (define msg-withdraw three)
    (define msg-print four)
;    
    ((k1 msg-print))   
    ((k1 msg-deposit) ten)
    ((k1 msg-print))   
    ((k1 msg-withdraw) four)   
    ((k1 msg-print))   
;
    ((k2 msg-print))   
    ((k2 msg-deposit) nine)   
    ((k2 msg-print))   
    ((k2 msg-withdraw) seven) 
    ((k2 msg-print))))
;
(konto)
;;;;;                 -->10
;;;;;                    20
;;;;;                    16
;;;;;                    5
;;;;;                    14
;;;;;                    7



Georg P. Loczewski 2004-03-05


Impressum und Datenschutz