Hacker News new | past | comments | ask | show | jobs | submit login

Those are 3 distinct types in Clojure; unfortunately they have no equivalents in JavaScript, thus they become strings.



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.


Keywords 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/cloju...


They can be used as functions, but I think they're implemented differently for optimization. Could be wrong.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: