X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=using_the_programming_languages.mdwn;h=6952e4995bbddbabd71a24cd0c4ed64462947a22;hp=deef2ee1c0894b874d79188a80fb2915d73c82c2;hb=b19700a93e5cd8137872f9727c734f4f9c953b89;hpb=701e1a701a0275a6a0294cba81df0e1984fa2768 diff --git a/using_the_programming_languages.mdwn b/using_the_programming_languages.mdwn index deef2ee1..6952e499 100644 --- a/using_the_programming_languages.mdwn +++ b/using_the_programming_languages.mdwn @@ -43,8 +43,17 @@ know much OCaml yet to use it. Using it looks like this: let add = << fun m n -> n $succ$ m >>;; (* or *) let add = << fun m n -> fun s z -> m s (n s z) >>;; - - church_to_int << $add$ $one$ $two$ >>;; + . + (* now use: + pp FORMULA to print a formula, unreduced + pn FORMULA to print the normal form of a formula (when possible) + pi FORMULA to print the integer which FORMULA is a Church numeral for (when possible) + . + alpha_eq FORM1 FORM2 are FORM1 and FORM2 syntactically equivalent (up to alpha-conversion)? + this does not do reductions on the formulae + *) + . + pi << $add$ $one$ $two$ >>;; - : int = 3 To install this package, here's what you need to do. I've tried to explain it in basic terms, but you do need some familiarity with your operating system: for instance, how to open a Terminal window, how to figure out what directory the Terminal is open to (use `pwd`); how to change directories (use `cd`); and so on.