I am working on a recursive function that takes a list and a value ex: 'b '(a. b), and returns nil if not found and t if found. my issue is in the line (cond ((eq A (car L)) t), it seems to be checking that condition even after (cond ((and (atom L (eq A L)) t) returns. I am under the impression that if that condition is met, execution stop and the function returns. Any way to fix this? Also, im only able to use primitive functions defun cond cons car cdr operators +, -, <, and > null eq listp atom symbolp
;test cases
(checkInner 'b '(a . b))
(checkInner 'f '(c e f))
(checkInner 'b '(b))
;function
(defun checkInner(A L)
(cond ((and (atom L) (eq A L)) t)
)
(cond ((or (atom L) (eq A L)) nil)
)
(cond ((eq A (car L)) t)
(t (checkInner A (cdr L))
)
)
)
condis returned by the function.