This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-08-19
Channels
- # babashka (13)
- # beginners (4)
- # biff (1)
- # cider (15)
- # clerk (1)
- # clojure (18)
- # clojure-europe (10)
- # clojure-nl (1)
- # clojure-uk (1)
- # core-logic (2)
- # core-typed (2)
- # datomic (23)
- # defnpodcast (1)
- # emacs (4)
- # fulcro (25)
- # hyperfiddle (8)
- # music (1)
- # off-topic (21)
- # podcasts-discuss (1)
- # polylith (6)
- # releases (1)
- # squint (19)
- # tools-deps (10)
How does the REPL work? I saw there's a repl
command in squint, it bring me to a REPL without any code loaded. Can I have a repl connected to the app runtime, and how it works with cherry?
How do you think about supporting bigint notation, e.g. 1N
to BigInt("1")? I want to implement it but don't know where to start.
Yep, currently it has to be (js/BigInt 1)
. However Clojure supports BigInt by this format.
Ah, it's not about how much characters. I'm just wondering if squint is not going to fully compatible with ClojureScript. May some changes recently added in modern JS/TS be condisidered as well.
This is true, I'll consider it, you're the first to mention this syntax, I didn't know it existed
This is the behavior in Clojure.
Clojure 1.11.1
user=> (type 1)
java.lang.Long
user=> (type 1N)
clojure.lang.BigInt
This is the behavior in ClojureScript.
cljs.user> (type 1)
#object[Number]
cljs.user> (type 1N)
#object[Number]
cljs.user> (type (js/BigInt "1"))
#object[BigInt]
The difference in JVM Clojure and JS is:
user=> (+ 1 10N)
11N
Node:
> 1 + 11N
1 + 11N
> 1 + BigInt(11)
Uncaught TypeError: Cannot mix BigInt and other types, use explicit conversions
There might be good reasons that CLJS hasn't chosen to convert to BigInt even after it existed so code would still work in cases like this. I don't know their trade-offs. I'd suggest discussing this there first (#C07UQ678E) to get some more info
Alright it seems CLJS is kinda open to 1234N now: https://github.com/clojure/clojurescript/pull/214/files I'll track that and follow up here: https://github.com/squint-cljs/squint/issues/337