It is easy to express and
, or
, and not
in terms of if
(with an assist from a local binding for or
). I'd like to know if the reverse is true. My naïve first attempt:
(if test conseq altern) => (or (and test conseq) altern)
However, if test
is non-#f
and conseq
is #f
, the translation evaluates to altern
, which is incorrect.
Is there a translation that evaluates to the correct value while maintaining the short-circuit nature of if
?
Sounds like you have a good explanation why
if
is doing a little more thanand
andor
. But if you could cheat and add alambda
to delay the actual result: