Open kilianmh opened 1 month ago
My first thought is that a function to cast non-t to nil (like partially applied eq t
) would accomplish the same thing without needing to introduce macros.
A function should also work and if we inline it there should be no performance penalty.
I can do the PR if you tell me which functions you want and with which name.
It should look like this then?
(defun if-t (test then &optional else)
"If TEST evaluates to T, evaluate THEN and return its values,
otherwise evaluate ELSE and return its values. ELSE defaults to NIL."
(if test
(if (eq test t)
then
else)
else))
(declaim (inline if-t))
Sometime conditionals that test for
t
instead of non-nil are desired.In this situation it might be convenient to have:
if-t
,when-t
,cond-t
or maybe evenor-t
andand-t
.What do you think? @ruricolist