Church numerals: Difference between revisions
Content added Content deleted
ReeceGoding (talk | contribs) m (→{{header|R}}: Syntax highlighting.) |
ReeceGoding (talk | contribs) m (→{{header|R}}) |
||
Line 1,877: | Line 1,877: | ||
exptAlt<-function(n){function(m) m(mult(n))(one)}</lang> |
exptAlt<-function(n){function(m) m(mult(n))(one)}</lang> |
||
Extra tests - mostly for the alt versions - not present in the Racket solution: |
Extra tests - mostly for the alt versions - not present in the Racket solution: |
||
<lang |
<lang rsplus>churchToNat(addAlt(three)(four)) |
||
churchToNat(multAlt(three)(four)) |
churchToNat(multAlt(three)(four)) |
||
churchToNat(exptAlt(three)(four)) |
churchToNat(exptAlt(three)(four)) |