This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-28
Channels
- # announcements (14)
- # autochrome-github (1)
- # babashka (4)
- # beginners (151)
- # biff (1)
- # calva (24)
- # cider (13)
- # clara (13)
- # clj-commons (1)
- # cljs-dev (24)
- # clojure (50)
- # clojure-europe (20)
- # clojure-france (13)
- # clojure-nl (4)
- # clojure-norway (12)
- # clojure-spec (43)
- # clojure-uk (6)
- # clojurescript (30)
- # cursive (2)
- # datahike (9)
- # editors (6)
- # emacs (2)
- # fulcro (29)
- # google-cloud (20)
- # graphql (2)
- # humbleui (2)
- # jobs (2)
- # juxt (4)
- # kaocha (5)
- # lsp (14)
- # malli (5)
- # membrane (10)
- # off-topic (39)
- # pathom (21)
- # polylith (10)
- # rdf (8)
- # reagent (4)
- # remote-jobs (3)
- # reveal (18)
- # shadow-cljs (27)
- # spacemacs (7)
- # tools-deps (30)
Looks like a bug in CLJS compiler, and I couldn't find anything related in Jira: https://ask.clojure.org/index.php/11607/binding-js-variable-to-variable-binds-nil
just ran into this the other day myself, xposting this https://clojurians.slack.com/archives/C03S1L9DN/p1646055931158349?thread_ts=1646040199.234749&cid=C03S1L9DN
@p-himik @lilactown are you both trying this at the top-level though?
literal code was
(defn start!
[]
(let [window (js/window.open "" "" "")
container (.. window -document (createElement "div"))]
window))
@lilactown that's better thanks 🙂 people do top-level let
so it wasn't clear
Would a patch be welcome with something like
(core/defmacro js-exponentiate [base exponent]
(core/list 'js* "~{} ** ~{}" base exponent))
The goal would be to replace the js*
call in (js* "~{} ** ~{}" (js/BigInt 10) (js/BigInt 2))
, since Math/pow
can’t exponentiate bigint instances@dnolen all I see is a wrapper over Math/pow
: https://github.com/quoll/cljs-math/blob/main/src/cljs/math.cljc#L499-L504
@sritchie09 are **
and Math/pow
semantically the same other than the boundary across types?
according to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Exponentiation, It is equivalent to Math.pow, except it also accepts BigInts as operands.
I have been looking to expand cljs-math to BigInt, but it's still a work in progress. Sam’s suggestion seems good at face value
I believe @dnolen and @quoll that an older version of the closure compiler didn’t like **
, which led to me make this PR to Fraction.js before understanding this fully: https://github.com/infusion/Fraction.js/pull/43#issuecomment-881054662
we should be okay now with the version cljs uses.