--- /dev/null
+#lang racket
+
+(define (make-account balance password)
+ (define (withdraw amount)
+ (if (>= balance amount)
+ (begin (set! balance (- balance amount))
+ balance)
+ "Insufficient funds"))
+ (define (deposit amount)
+ (set! balance (+ balance amount))
+ balance)
+ (define (dispatch given-password m)
+ (if (eq? given-password password)
+ (cond ((eq? m 'withdraw) (lambda (amt) (withdraw amt)))
+ ((eq? m 'deposit) (lambda (amt) (deposit amt)))
+ (else (error "Unknown request -- MAKE-ACCOUNT"
+ m)))
+ (lambda (temp) "Incorrect password")))
+ dispatch)
+
+(define (make-joint account acc-password joint-password)
+ (define (dispatch given-password m)
+ (if (eq? given-password joint-password)
+ (account acc-password m)
+ (lambda (temp) "incorrect password!")))
+ dispatch)
+
\ No newline at end of file
--- /dev/null
+#lang racket
+
+(define f
+ (let ((x 0))
+ (lambda (y)
+ (set! x (+ x 1))
+ (cond
+ ((and (= x 1) (= y 0)) -1)
+ ((and (= x 2) (= y 1)) 1)
+ ((and (= x 1) (= y 1)) 0)
+ ((and (= x 2) (= y 0)) 1)))))
+
\ No newline at end of file