X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=topics%2Fweek4_fixed_point_combinators.mdwn;h=9c32b04ed8864c1b76cb5762fc2a086debee04a7;hp=c904bdc837a9a84233f3ac517c49b298c2d9d13e;hb=120431d951d97e47c6b80f91f41e2c352c073703;hpb=ce10606b3b1de35a37d4f4df12eeedd1e434b0e1 diff --git a/topics/week4_fixed_point_combinators.mdwn b/topics/week4_fixed_point_combinators.mdwn index c904bdc8..9c32b04e 100644 --- a/topics/week4_fixed_point_combinators.mdwn +++ b/topics/week4_fixed_point_combinators.mdwn @@ -186,7 +186,7 @@ returns `#t`, because if we follow the path from the head of the list argument, (looking '(6 2 grits caviar 5 7 3)) -our path will take us from `6` to `7` to `3` to `grits`, which is not a number but not the `'caviar` we were looking for either. So this returns `#f`. It would be very difficult to define these functions without recourse to something like `letrec` or `define`, or the techniques developed below (and also in that chapter of *The Little Schemer*. +our path will take us from `6` to `7` to `3` to `grits`, which is not a number but not the `'caviar` we were looking for either. So this returns `#f`. It would be very difficult to define these functions without recourse to something like `letrec` or `define`, or the techniques developed below (and also in that chapter of *The Little Schemer*). ## Using fixed-point combinators to define recursive functions ## @@ -269,6 +269,7 @@ it's not complete, since we don't know what value to use for the symbol `LENGTH`. Technically, it has the status of an unbound variable. + Imagine now binding the mysterious variable, and calling the resulting term `h`: @@ -540,7 +541,7 @@ where `BODY` is equivalent to the very formula `\n. BODY n` that contains it. So BODY M <~~> ... -You've written an infinite loop! +You've written an infinite loop! (This is like the function `eternity` in Chapter 9 of *The Little Schemer*.) However, when we evaluate the application of our: