Код Ревью
Сравни свои решения
(define (make-account balance acc-num)
(define (withdraw amount)
(if (>= balance amount)
(begin
(set! balance (- balance amount))
balance)
"Not enough money"))
(define (deposit amount)
(set! balance (+ balance amount))
balance)
(let ([balance-serializer (make-serializer)])
(define (dispatch m)
(cond
[(eq? m 'withdraw) withdraw]
[(eq? m 'deposit) deposit]
[(eq? m 'serializer) balance-serializer]
[(eq? m 'balance) balance]
[(eq? m 'number) acc-num]
[else (error "Wrong request -- MAKE-ACCOUNT" m)]))
dispatch))
(define (serialized-exchange account1 account2)
(let ([serializer1 (account1 'serializer)]
[serializer2 (account2 'serializer)])
(when (< (account2 'number) (account1 'number))
(begin
(set! serializer1 (account2 'serializer))
(set! serializer2 (account1 'serializer))))
((serializer1 (serializer2 exchange)) account1 account2)))