3 (define (make-account balance password)
4 (define (withdraw amount)
5 (if (>= balance amount)
6 (begin (set! balance (- balance amount))
9 (define (deposit amount)
10 (set! balance (+ balance amount))
12 (define (dispatch given-password m)
13 (if (eq? given-password password)
14 (cond ((eq? m 'withdraw) (lambda (amt) (withdraw amt)))
15 ((eq? m 'deposit) (lambda (amt) (deposit amt)))
16 (else (error "Unknown request -- MAKE-ACCOUNT"
18 (lambda (temp) "Incorrect password")))
21 (define (make-joint account acc-password joint-password)
22 (define (dispatch given-password m)
23 (if (eq? given-password joint-password)
24 (account acc-password m)
25 (lambda (temp) "incorrect password!")))