A Better Version of IF-N-Z-P
Let’s improve this macro so that:
1. It evaluates the test expression only once;
2. It uses a temporary symbol for its local variable to avoid the possibility of “Variable Capture.”
(defmacro if-n-z-p (expr f1 f2 f3)
(cond ((minusp ,val) ,f1)
((plusp ,val) ,f3) ) ) ) )
GENSYM creates a new symbol, distinct from all others currently in use. This is protection against the possibility of a “variable-capture” bug.