Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ex-1.5

  • Loading branch information...
commit 42b966c513ed5e7437772d3145293489b3fe084c 1 parent 3138a4d
@dchelimsky authored
Showing with 26 additions and 1 deletion.
  1. +26 −1 chapter-1/ex-1.5.scm
View
27 chapter-1/ex-1.5.scm
@@ -12,5 +12,30 @@
; describe what happens with the above with:
; normal-order evaluation
; applicative-order evaluation
+
+;;;;;;;;;;;;;;
+; Background
+;
+; The p function itself results in an infinite loop.
+
+;;;;;;;;;;;;;;
+; Normal Order
+;
+; result: 0
+;
+; this
+(test 0 (p))
+; becomes this
+(if (= 0 0) 0 (p))
+; which returns 0 before (p) is ever eval'd
+
+;;;;;;;;;;;;;;
+; Applicative Order
+;
+; result: infinite loop
;
-; TODO
+; this
+(test 0 (p))
+; becomes this
+(test 0 (p))
+; etc, because (p) expands to (p), which must then be expanded (to (p)), etc
Please sign in to comment.
Something went wrong with that request. Please try again.