Fork me on GitHub
#clojure
<
2022-06-05
>
pinkfrog03:06:18

The doc of declare says defs the supplied var names with no bindings. But to be accurate, it binds to clojure.lang.Var$Unbound. (declare test). (when test (println "foobar")) indeed prints.

hiredman03:06:06

No bindings doent mean nil, if I recall way back before 1.x some time referencing such a var would throw an exception when compiling

devn20:06:39

fwiw there is (bound? #'foo) , but i will admit i am slightly surprised. i wonder what the rationale for an unbound var being truthy is

phill08:06:14

the efficiency of fewer things to check for in every conditional may have played a role