when i create a new reagant project with lein i get the following error Cannot read properties of undefined (reading 'render')...if made zero edits to the project that is generated. anyone else encounter this?
Did you install react?
yes i see it in my node_modules
[reagent "1.1.1"]
[reagent-utils "0.3.4"]
[cljsjs/react "17.0.2-0"]
[cljsjs/react-dom "17.0.2-0"]I would avoid using cljsjs and install using npm directly
clj
(/ 100 3) => 100/3 Ratio type
cljs
(/ 100 3) => 33.333 Number type
what is the reason behind this disparity?I think the reasoning is • Because a rational type does not exist in JavaScript. • It would be kind of slow to emulate one. See differences here https://clojurescript.org/about/differences#_the_reader
hi thanks
i have read the differences page but there is no explanation there
in java there is no ratio as well, it's under the clojure.lang.Ratio
so is it just because performance wise?
why is it more critical in js?
Overall Clojure is a hosted language. So the most popular concepts that the hosting environment has should be accessible. JavaScript doesn't have one so I guess it made the initial porting effort easier.
I don't know. I see the Clojure implementation being in the tradition of other lisps.
I tend to avoid rationals because I usually just need the fastest floating point numbers. Java does have BigDecimal and BigInteger so maybe it seemed like a good addition 🤷
clojure.lang.Ratio is implemented in terms of those Java classes so it'll be easier there.
There's an ask clojure question about this plus a ticket; https://ask.clojure.org/index.php/5887/clone-implement-ratios
I was kind of surprised to see "Hosted on the JVM" on https://clojurescript.org/about/differences – I guess it's strictly following the "section-by-section" comparison to http://clojure.org
I think that the cljs reader could accept 3/4 and emit (3/4)