questioninline internal procedures deposit and


Question

Inline internal procedures deposit and withdraw. That is, replace references to them by the bodies of procedures. Then you are able to eliminate the definitions of those procedures. How to turn scheme code below into inline?

(define make-account-lambda
(lambda (balance)
(define withdraw (lambda (amount)
(if (>= balance amount)
(begin (set! balance (- balance amount))
balance)
"Insufficient funds")))
(define deposit (lambda (amount)
(set! balance (+ balance amount))
balance))
(lambda (m)
(cond ((eq? m 'withdraw) withdraw)
((eq? m 'deposit) deposit)
(else (error "Unknown request -- MAKE-ACCOUNT"
m))))))

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: questioninline internal procedures deposit and
Reference No:- TGS0444078

Expected delivery within 24 Hours