4 ms·
I don't understand the difference between fn and fn* . After some brief experimenting in the REPL, they seem to behave exactly the same, the only difference bei
by Totient 12y ago
I don't understand the difference between fn and fn* . After some brief experimenting in the REPL, they seem to behave exactly the same, the only difference being that fn* is what comes out of macro expanding the #( macro
Is there a reason that the #( macro doesn't expand to plain old fn?
- MBlume 12y agofn is a macro that knows how to apply destructuring rules, fn* is a primitive read by the clojure compiler and cannot apply destructuring rules. https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L4143 https://github.com/clojure/clojure/blob/master/src/clj/cloju...
- diego 12y agofn itself is a macro, fn* is a symbol defined at the compiler level: static final Symbol FN = Symbol.intern("fn*");