This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-25
Channels
- # 100-days-of-code (6)
- # announcements (4)
- # aws (2)
- # beginners (151)
- # boot (1)
- # calva (1)
- # cider (19)
- # clara (47)
- # cljdoc (9)
- # cljs-dev (25)
- # clojars (18)
- # clojure (151)
- # clojure-canada (1)
- # clojure-conj (1)
- # clojure-dev (17)
- # clojure-italy (42)
- # clojure-nl (34)
- # clojure-spec (67)
- # clojure-uk (125)
- # clojurescript (163)
- # core-async (106)
- # cursive (19)
- # data-science (11)
- # datomic (9)
- # duct (2)
- # figwheel (1)
- # figwheel-main (6)
- # fulcro (97)
- # graphql (9)
- # instaparse (4)
- # jobs (6)
- # jobs-discuss (21)
- # leiningen (62)
- # mount (23)
- # off-topic (16)
- # re-frame (15)
- # reagent (16)
- # reitit (5)
- # remote-jobs (1)
- # ring-swagger (9)
- # shadow-cljs (176)
- # tools-deps (102)
- # unrepl (3)
Small bit of progress on release-blocker https://dev.clojure.org/jira/browse/CLJS-2793 ... the experimental patch in it also fixes https://dev.clojure.org/jira/browse/CLJS-2942
Looking again at the experimental patch, it probably fails under advanced because it does
(gobj/get f (str "cljs$core$IFn$_invoke$arity$" ...
(Dunno why I hadn't noticed that earlier.)I probably wrote it that way to make it dynamic... (it is adding the arg count to the end of that str
call)
I believe it lets you get at the renamed properties at runtime using the original name
Hmm. It appears empirically that you must past a compile-time constant string to goog.reflect/objectProperty
, otherwise Closure compilation fails.
This seems to make sense to me in that it can't do anything with runtime values.
I'll try a different experiment that simply unrolls regular property access out to arity 20 or so
(not saying it's the right way for this problem, just if it seemed like a good fit etc)
An expansion of this fn is what I'm trying now. Perhaps it could be improved, but it should work
(defn- get-arity-dispatch [f n]
(case n
0 (.-cljs$core$IFn$_invoke$arity$0 f)
1 (.-cljs$core$IFn$_invoke$arity$1 f)))
A macro could write that fn for me, but it is easy enough to just write it by hand for now 🙂
Hrm. That does't lead to things passing under :advanced
either. Will hack on this later.
Added a bit more to https://dev.clojure.org/jira/browse/CLJS-2793
For me at least, the stuff in that ticket gets things closer to working (but without fully working under :advanced
) without having a true comprehension on how things are subtly derailing.