Church numerals: Difference between revisions

Content added Content deleted
m (→‎{{header|R}}: Syntax highlighting.)
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 r>churchToNat(addAlt(three)(four))
<lang rsplus>churchToNat(addAlt(three)(four))
churchToNat(multAlt(three)(four))
churchToNat(multAlt(three)(four))
churchToNat(exptAlt(three)(four))
churchToNat(exptAlt(three)(four))