I can define church numerals fairly easy using scheme:
> (define f (lambda (x) x))
> (f f) ;0
#<procedure:f>
> (f (f f)) ;1
#<procedure:f>
However, this doesn't make it very easy to recognize that (f f)
is 0 and (f (f f)) is 1. Is there a way that I can make these numerals more readable? What would be ideal is this:
> (f f)
0
> (f (f f))
1
The example is in scheme, but I'll take an answer in any lisp.