Difficulty: Easy
Correct Answer: (evenp
Explanation:
Introduction / Context:
Common LISP provides a rich set of numeric predicates for testing properties of numbers. Knowing the idiomatic names of these predicates is important for writing readable, conventional LISP code and for understanding legacy AI codebases that rely on LISP macros and functions.
Given Data / Assumptions:
Concept / Approach:
The canonical predicates for parity in Common LISP are evenp and oddp. The suffix “p” conventionally marks a predicate returning t or nil. There is no standard predicate named even, and fabricated names like numeven or numnevenp are not part of the standard.
Step-by-Step Solution:
Verification / Alternative check:
Common LISP HyperSpec documents evenp and oddp as standard numeric predicates for integers, confirming the choice.
Why Other Options Are Wrong:
Common Pitfalls:
Forgetting the “p” suffix for predicates in LISP; confusing Common LISP with Scheme function names.
Final Answer:
(evenp <integer>)
Discussion & Comments