Function definition: Difference between revisions

m
imported>Tromp
Line 1,107:
In lambda calculus, multiplication on Church numerals is <code>mul = \m \n \f. m (n f)</code> which in BLC is
 
<syntaxhighlightpre>00 00 00 01 1110 01 110 10</syntaxhighlightpre>
 
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
 
<syntaxhighlightpre>00 01 00 01 01 10 110 01 01 10 110 110 0000000111100111010</syntaxhighlightpre>
 
=={{header|BQN}}==
56

edits