So I wrote this code. How do i get the x in the if statement to evaluate? at the moment, x always succeeds, and the if statement never fails.
(define expand
(lambda (exp)
(cond
((symbol? exp) exp)
((pair? exp)
(case (car exp)
((and)
(if (null? (cdr exp)) '(quote #t)
(if (null? (cddr exp)) (cadr exp)
(let ((x (cadr exp))
(thunk (lambda () (expand '(and ,(cddr exp))))))
(if x (thunk)
`(quote ,x))))))
(else exp)))
(else exp))))