Created
September 18, 2009 19:42
-
-
Save jimweirich/189248 to your computer and use it in GitHub Desktop.
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
;; SICP 1.5 | |
;; Given: | |
;; | |
;; (define (p) (p)) | |
;; | |
;; (define (test x y) | |
;; (if (= x 0) | |
;; 0 | |
;; y)) | |
;; (test 0 (p)) | |
;; | |
;; Since applicative order evaluates the arguments before calling the | |
;; function, the (p) expression results in an infinite recursion. And | |
;; since scheme has TCO, the interpreter will enter an infinite loop. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment