It is almost equivalent, but not quite. Consider what happens if the form is (incorrectly) ()
. As written, this error gets at compile time, because it does not allow to evaluate (nil x)
. With the proposed simplification, an error will be noticed at runtime, or perhaps never at all, if x
is a function with no arguments.
Leaving aside correctness, this is also better for readability, as it emphasizes what the first form will be called and the rest as arguments. It is also a prettier symmetry with the implementation ->
.
source share