If you want to define opand
as a function with 2 parameters, like you are trying to, you need to do this:
(defun OPAND (p q)
(funcall (funcall p q) p) )
and then:
(opand false false)
#<FUNCTION :LAMBDA (X) #'(LAMBDA (Y) Y)> ;; which is FALSE
(opand true true)
#<FUNCTION :LAMBDA (X) #'(LAMBDA (Y) X)> ;; which is TRUE
This is my implementation, based on the original paper http://www.utdallas.edu/~gupta/courses/apl/lambda.pdf, of the and
operator λxy.xyF
(defvar OPAND
#'(lambda(x)
#'(lambda(y)
(funcall (funcall x y) FALSE) ) ) )
And if you do
(funcall (funcall opand false) false)
#<FUNCTION :LAMBDA (X) #'(LAMBDA (Y) Y)> ;; which is FALSE
(funcall (funcall opand true) true)
#<FUNCTION :LAMBDA (X) #'(LAMBDA (Y) X)> ;; which is TRUE