3 ms·
To my knowledge, keywords are actually functions in Clojure, which do have an equivalent in JS. "Looks more like Clojure" seems like a good enough reason to me
by dhamidi 13y ago
To my knowledge, keywords are actually functions in Clojure, which do have an equivalent in JS. "Looks more like Clojure" seems like a good enough reason to me.
- adrusi 13y agoThey can be used as functions, but I think they're implemented differently for optimization. Could be wrong.
- i_s 13y agoKeywords implement many interfaces, function (IFn) being one of them. See this line in the clojure source code: public class Keyword implements IFn, Comparable, Named, Serializable, IHashEq https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Keyword.java#L24 https://github.com/clojure/clojure/blob/master/src/jvm/cloju...