Read-time evaluation of functions work as expected. For instance, submitting #=(+ 1 1)
to the REPL will indeed return 2
. However, read-time evaluation forms such as (if true 1 0)
will produce an error. The errors reported are not consistent across macros and special forms.
#=(if true 1 0)
;;=> Can't resolve if
#=(let [] nil)
;;=> Wrong number of args (2) passed to: clojure.core/let
Is this expected behavior? Languages like Common Lisp do not produce errors in this scenario--e.g. the code #.(if t 1 0)
returns 1
.