In case representing pairs as procedures wasn't mind-boggling enough, consider that, in a language that can manipulate procedures, we can get by without numbers (at least insofar as nonnegative integers are concerned) by implementing
and the operation of adding
(define zero (lambda (f) (lambda (x) x))) (define (add-1 n) (lambda (f) (lambda (x) (f ((n f) x)))))
This representation is known as Church numerals, after its inventor, Alonzo Church, the logician who invented the λ calculus.
directly (not in terms of
). (Hint: Use substitution to evaluate
). Give a direct definition of the addition procedure + (
) (not in terms of repeated application of
There are no comments yet.
You must log in to post a comment.Login