Skip to content

Instantly share code, notes, and snippets.

@ryanbriones
Forked from jimweirich/gist:189248
Created September 25, 2009 03:49
Show Gist options
  • Save ryanbriones/193282 to your computer and use it in GitHub Desktop.
Save ryanbriones/193282 to your computer and use it in GitHub Desktop.
SICP Exercise 1.5
;; 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