This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-30
Channels
- # announcements (12)
- # babashka (25)
- # biff (30)
- # cherry (34)
- # cider (46)
- # clj-kondo (23)
- # clojure (37)
- # clojure-berlin (6)
- # clojure-europe (12)
- # clojure-nl (4)
- # clojure-norway (6)
- # clojure-uk (2)
- # clojurescript (8)
- # conjure (1)
- # cursive (4)
- # data-science (11)
- # datalevin (12)
- # datascript (15)
- # emacs (2)
- # events (1)
- # fulcro (14)
- # graalvm (16)
- # gratitude (23)
- # honeysql (11)
- # jobs (2)
- # jobs-discuss (14)
- # kaocha (1)
- # leiningen (8)
- # nbb (45)
- # off-topic (7)
- # portal (8)
- # re-frame (9)
- # releases (2)
- # shadow-cljs (24)
- # squint (5)
- # tools-build (17)
- # tools-deps (7)
- # vim (5)
Wait a minute. I think it's better after all to use {}
instead of js/Map
here, since JS kind of does the right thing with {}
for group-by-ish use cases:
$ ./node_cli.js -e '(prn (get (assoc {} [1 2 3] 4) [1 2 3]))'
4
vs
$ ./node_cli.js -e '(prn (get (assoc (js/Map.) [1 2 3] 4) [1 2 3]))'
it stringifies the key when storing and also when looking up, so you won't hit the mutability reference-based equality stuff when quering for composite stuff
ClavaScript and WindowJS: https://twitter.com/borkdude/status/1564560835145617408
Maybe I'm too used to (verb noun) and how Clojure works, but:
(canvas.save)
(canvas.translate x y)
(canvas.rotate (/ (* t Math/PI) 2))
(canvas.fillRect -100 -100 200 200)
(canvas.restore))
Why not:
(doto canvas
(save)
(translate x y)
(rotate (/ (* t Math/PI) 2))
(fillRect -100 -100 200 200)
(restore))
Is that not supported by Clavascript?