humpolec wrote:Should I use (IF A B NIL), (IF A B), or (WHEN A B)? What is the convention?
I'm not 100% sure of the convention, but I tend to use IF where I'm providing a clause for both the true and false cases, and WHEN/UNLESS if the second clause would be NIL anyway.
Sometimes it clarifies my intentions (only do B if A is the case), but mostly it saves me looking for the alternative return clause in an IF statement: WHEN makes it explicitly clear that there isn't one.
I think this shares its motivation with my liking for the parentheses: lisp is great for avoiding ambiguity in my code.