Function definition: Difference between revisions

m
imported>Tromp
(add mul function definition in BLC)
imported>Tromp
Line 1,105:
=={{header|Binary Lambda Calculus}}==
 
In lambda calculus, multiplymultiplication on Church numerals is <code>mul = \m \n \f. m (n f)</code> which in BLC is
 
<syntaxhighlight>00 00 00 01 1110 01 110 10</syntaxhighlight>
 
If mul is used several times within an expression E, then they can share the same definition by using <code>(\mul. E)(\m\n\f. m (n f))</code>. For example, the cube function is <code>\n. (\mul. mul n (mul n n)) (\m\n\f. m (n f))</code> which in BLC is
 
<syntaxhighlight>00 01 00 01 01 10 110 01 01 10 110 110 0000000111100111010</syntaxhighlight>
Anonymous user