Jump to content

Church numerals: Difference between revisions

No edit summary
Line 1,786:
I feel we need an example from the original Lambda Calculus. I am here using a dialect that I invented that differs from real untyped Lambda Calculus in two ways:
 
1.# Variables can be longer than single letters. In canonical lambda calculus `''xy`'' would be considered an application of `''x`'' to `''y`''. In my dialect, it is the free variable `''xy`''. This change is made purely to allow readable variable names.
 
2.# I have named expressions introduced by `let`. For example, `''let succ = λn.λf.λx.n f (f x)`'' means that `such`''succ'' stands for the function on the right hand side. Conceptually, it is just syntactical sugar for `''λsucc.( .... everything else that follows ...) (λn.λf.λx.n f (f x))''. In particular, it does not introduce conventional recursion into the language.
 
<syntaxhighlight>
Line 1,828:
 
Note that since integers in Lambda Calculus are usually defined in terms of Church Numerals, the functions to convert between the two are both the identity function.
 
=={{header|Lambdatalk}}==
 
19

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.