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=bdba8d093ea5ecfd375e1b3e243b1efd6ea11a07;hb=df6a6fe6807edabf1b3c3e904eb2ead20eedf0ca;hpb=85bd77d2f5fc08beca4d2d65ccf9a6cf81b4a658 diff --git a/using_the_programming_languages.mdwn b/using_the_programming_languages.mdwn index bdba8d09..6952e499 100644 --- a/using_the_programming_languages.mdwn +++ b/using_the_programming_languages.mdwn @@ -1,5 +1,3 @@ -We assume here that you've already gotten [Schema and OCaml installed on your computer](/how_to_get_the_programming_languages_running_on_your_computer/). - ## Programming in the pure untyped lambda calculus ## @@ -45,14 +43,25 @@ 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. INCLUDE INSTRUCTIONS + We assume here that you've already [gotten OCaml installed on your computer](/how_to_get_the_programming_languages_running_on_your_computer/). + Some notes: * When you're talking to the interactive OCaml program, you have to finish complete statements with a ";;". Sometimes these aren't necessary, but rather than learn the rules yet about when you can get away without them, it's easiest to just use them consistently, like a period at the end of a sentence.