Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (make-withdraw initial-amount)
- (let ((balance initial-amount))
- (lambda (amount)
- (if (>= balance amount)
- (begin (set! balance (- balance amount)) balance)
- "Insufficient funds"))))
- (define wd (make-withdraw 100))
- (wd 10)
- (wd 10)
- (wd 90)
Advertisement
Add Comment
Please, Sign In to add comment