Lambda Calculus CONS Pair implementation with Lisp
问题 I'm trying to implement a Church Pair Lambda Calc. style with CLisp. According with Wikipedia: pair ≡ λx.λy.λz.z x y So far, this is my code: (defvar PAIR #'(lambda(x) #'(lambda(y) #'(lambda(z) (funcall (funcall z x) y)))) ) These are my FIRST and SECOND Functions: (defvar FIRST #'(lambda(p) (funcall(p TRUE))) ) (defvar SECOND #'(lambda(p) (funcall(p FALSE))) ) This 2 functions convert from Int to ChurchNumber (defun church2int(numchurch) (funcall (funcall numchurch #'(lambda (x) (+ x 1))) 0)