This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-06-09
Channels
- # announcements (12)
- # babashka (22)
- # beginners (17)
- # boot (6)
- # calva (45)
- # clj-kondo (17)
- # clojure (70)
- # clojure-australia (4)
- # clojure-europe (35)
- # clojure-finland (6)
- # clojure-losangeles (2)
- # clojure-nl (1)
- # clojure-uk (2)
- # clojured (26)
- # clojurescript (10)
- # conjure (1)
- # datahike (1)
- # events (1)
- # honeysql (14)
- # introduce-yourself (5)
- # jobs (5)
- # joyride (2)
- # minecraft (6)
- # off-topic (5)
- # pathom (14)
- # rewrite-clj (1)
- # shadow-cljs (13)
- # tools-build (6)
- # tools-deps (13)
- # vim (29)
- # xtdb (8)
I'm not sure if it's an issue only for me. When I raise and js/Error, its error stack will be correctly displayed. So I have source map, I can see which line caused the error. But if I throw ex-info
, the error will be displayed like this. Obviously, source map only work in this case.
hi everybody! is there a way of interning a var or just setting a global value like (set! js/a 42)
but with a
coming from a string? Something to accomplish the same as clojure (intern 'user (symbol "a") 42)
Interning - no.
Setting a global variable - yes, just use goog.object/set
on js/window
.
thanks! that works
TIL.
(str/replace 'and #"a" "")
=> Execution error (TypeError) at (<cljs repl>:1).
s.replace is not a function
While in Clojure:
(str/replace 'and #"a" "")
=> "nd"
the doc string does not document that as a valid input so you are in undefined territory
it's kind of an accident of implementation that it does
so, I wouldn't recommend it