This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; This is some code from chapter 3 of SICP. I chose it by going to | |
;; http://mitpress.mit.edu/sicp/code/index.html , clicking at random | |
;; and picking the first good, meaty function that caught my eye. It | |
;; is a demonstration of object orientation by way of functional | |
;; closures. | |
(define (make-account balance) | |
(define (withdraw amount) | |
(if (>= balance amount) | |
(begin (set! balance (- balance amount)) |