4 ms·
The coolest thing about :keywords in Clojure ... don't work in Wisp. Ok. That sucks. So pretty much anyone already a bit serious about Clojure wont be enticed
by josteink 13y ago
The coolest thing about :keywords in Clojure ... don't work in Wisp.
Ok. That sucks. So pretty much anyone already a bit serious about Clojure wont be enticed by this then.
Edit: From the page:
;; Keywords can be invoked as functions, that desugars to plain
;; associated value access in JS
(:bar foo) ;; => foo["bar"]
That seems pretty close to what's expected though, doesn't it?
- grayrest 13y agoI'd expect `(:bar foo)` to desugar to `foo["bar"]()` since the keyword is being used as a function. Property access in clojurescript uses the ugly `(.-bar foo)` syntax.
- piranha 13y agoNo, to get foo["bar"]() in CLJS you write ((:bar foo)). :bar in this case is a function, which returns a value by a key ":bar" from "foo", it's not a property.
- deleted 13y ago[deleted]