Skip to content

Instantly share code, notes, and snippets.

@jimweirich
Created September 18, 2009 19:42
Show Gist options
  • Save jimweirich/189248 to your computer and use it in GitHub Desktop.
Save jimweirich/189248 to your computer and use it in GitHub Desktop.
;; 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