X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=topics%2Fweek3_church_arithmetic.mdwn;h=17d38b08c0d26dd454aa52f8ce6e63bc254f93bc;hp=55f5ab22f3cd7fd01eeba628bccaa0ef70e782e3;hb=a4d2693effe839524592f4427465ff8d97625302;hpb=bb30f8bb8af91baf85d0ba1d05b7754ad73b1096 diff --git a/topics/week3_church_arithmetic.mdwn b/topics/week3_church_arithmetic.mdwn index 55f5ab22..17d38b08 100644 --- a/topics/week3_church_arithmetic.mdwn +++ b/topics/week3_church_arithmetic.mdwn @@ -71,3 +71,5 @@ Interestingly, `mul l r` defined in that second way eta-reduces to `\f. r (l f)` If we continue in this direction, we end up defining `l^r` (where `2^5` is `32`) either as `r (mul l) one` or as the *application* `r l` of `r` to `l`. Not all of the arithmetic encodings are so neat and elegant, however. As we mentioned, `pred` takes some ingenuity. We'll also have you define `zero?` and for homework. + +Here is an example of [some programmers having fun with Church numbers](http://www.schemers.org/Miscellaneous/imagine.txt). A tiny glossary: FORTRAN is a very old imperatival language that Scheme hoped to replace; SML is a sister language to OCaml; Chez is one Scheme implementation (like Racket and Chicken); and you will learn about "Y" next week. You should be able to figure out what the refrain means.