5 ms·
That's because defn binds f to the _value_ of the function, while (f) binds to the _variable_. > (defn f [] (f)) #'sandbox9672/f > (def g f) #'sandbox9
by jeremiep 10y ago
That's because defn binds f to the _value_ of the function, while (f) binds to the _variable_.
> (defn f [] (f))
#'sandbox9672/f
> (def g f)
#'sandbox9672/g
> (def f 42)
#'sandbox9672/f
> (g)
java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn