This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: (define (deposit amount pass-try) (if (eq? password pass-try) (begin (set! balance (+ balance amount)) (set! incor-pass 0) balance) (begin (set! incor-pass (+ incor-pass 1)) "Incorrect password"))) (define (dispatch m) (cond ((eq? m 'withdraw) withdraw) ((eq? m 'deposit) deposit) (else (error "Unknown request -- MAKE-ACCOUNT" m)))) dispatch)) ;; Exercise 3.7 (define (make-joint acc pass-try new-pass) (lambda (try method) (if (eq? try new-pass) (acc pass-try method) (error "Incorrect password!")))) ;; Exercise 3.8 (define f (let ((j 1)) (lambda (x) (set! j (* j x)) j))) ( ;; Exercise 3.10 ; I drew it out for the practice. .. but I ; don't know how i'm supposed to turn it in now. ; ;; Exercise 3.11 ; I drew it out for the practice. .. but I ; don't know how i'm supposed to turn it in now. ;...
View Full Document
- Spring '10