This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-23
Channels
- # announcements (6)
- # beginners (54)
- # calva (9)
- # cider (2)
- # clj-kondo (26)
- # cljsrn (2)
- # clojure (49)
- # clojure-brasil (1)
- # clojure-dev (3)
- # clojure-europe (11)
- # clojure-italy (28)
- # clojure-nl (5)
- # clojure-serbia (1)
- # clojure-spec (4)
- # clojure-uk (182)
- # clojuredesign-podcast (2)
- # clojurescript (59)
- # clojurex (9)
- # cursive (26)
- # data-science (11)
- # datomic (40)
- # duct (1)
- # emacs (3)
- # events (4)
- # figwheel-main (2)
- # fulcro (7)
- # instaparse (1)
- # kaocha (2)
- # leiningen (25)
- # off-topic (3)
- # re-frame (36)
- # reagent (15)
- # shadow-cljs (87)
- # spacemacs (12)
- # sql (20)
- # tools-deps (8)
- # vim (1)
- # yada (40)
how do I get access to the javascript this
inside that function when writing this from clojurescript?
Me, upon reading this:
why are keyword qualifiers disallowed in #js {}
?
$ planck
ClojureScript 1.10.339
cljs.user=> #js {:foo/bar 1}
JavaScript literal keys must be strings or unqualified keywords.
https://github.com/clojure/clojurescript/blob/f289ffee2270567f7976d45012a0a52c38eb6488/src/main/clojure/cljs/tagged_literals.cljc#L63-L66This is not an answer to your question, but who knows maybe this helps you: cljs-bean
seems to support namespaced keywords… https://github.com/mfikes/cljs-bean/issues/67
Thanks, Stefan. I already use applied-science.js-interop
so can use it's j/obj
for this. so I am just curious whether there is a legit justification for this.
@U11BV7MTK there is none, I was asking from another point of view
I was thinking about dev time "support", like using qualifiers to aid autocomplete, and narrow down keys set for a particular js obj I might build. So in source code it'd be e.g.`#js {:css/width 10}` and in js, ofc {"width": 10}
when this was originally done as a surface syntax it was only for the convenience of saving a character
well, yes, I understand, that in js obj it'll be string. but I type in keyword on keyboard.
and your confusion shows that saving a keystroke was probably questionable design idea from one perspective
I would not say I am confused. It just seems to me that what I ask is the same as saving 1 char. I do not expect any qualified keyword semantics to get transferred to js obj. What I'm saying, is "there is a value in typing in qualified keyword because of IDE suggests assists" the same way there is a value in "saving a char" which is already there.
I understand quite clearly what you're saying, but I'm also explaining why it isn't a good idea
@misha one typical read time thing that people might expect if you allow this is namespace aliasing
In the middle of Uncle Bob's latest blog post about Clojure, there's a cool bit about ClojureScript. http://blog.cleancoder.com/uncle-bob/2019/08/22/WhyClojure.html > ClojureScript and ran in the Browser at even higher frame-rates He's referring to http://spacewar.fikesfarm.com 🙂
> I’m still trying to figure that out. So what’s your explanation @U04VDQDDY? 🙂
Another interesting aspect is that the graphics primitives are more cleanly rendered in the browser
Preparing to the meeting next week, with @jsa-aerial 's talk about interactive data visualization and literate programming with Hanami&Saite: https://twitter.com/scicloj/status/1164887113680281600