This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-22
Channels
- # bangalore-clj (6)
- # beginners (110)
- # boot (49)
- # cider (13)
- # cljs-dev (35)
- # cljsrn (5)
- # clojure (145)
- # clojure-conj (3)
- # clojure-dev (60)
- # clojure-italy (2)
- # clojure-nl (3)
- # clojure-russia (3)
- # clojure-serbia (1)
- # clojure-spec (116)
- # clojure-uk (58)
- # clojurescript (235)
- # cursive (14)
- # datascript (7)
- # datomic (31)
- # dirac (144)
- # emacs (1)
- # events (1)
- # hoplon (12)
- # leiningen (11)
- # luminus (60)
- # lumo (19)
- # off-topic (18)
- # om (74)
- # onyx (5)
- # pedestal (13)
- # precept (3)
- # re-frame (3)
- # reagent (15)
- # remote-jobs (7)
- # ring-swagger (25)
- # rum (1)
- # untangled (53)
- # vim (3)
is there official documentation about AOT besides https://clojure.org/reference/compilation
Re docs, that's it
Re recompile, no - what would "it" be here?
RT.load
is simple enough but do classes still call that or do they directly refer to classes?
compile
sets up a compilation context, every namespace loaded within that compile
call will get compiled
the point I’m confused about is whether or not it still recompiles once it has loaded a class (and didn’t reocmpile it)
if you (ns foo (:require bar :reload))
, change bar
and foo
and recompile foo
, bar
will get recompiled too
(defn proxy-call-with-super [call this meth]
(let [m (proxy-mappings this)]
(update-proxy this (assoc m meth nil))
(try
(call)
(finally (update-proxy this m)))))
(defmacro proxy-super
"Use to call a superclass method in the body of a proxy method.
Note, expansion captures 'this"
{:added "1.0"}
[meth & args]
`(proxy-call-with-super (fn [] (. ~'this ~meth ~@args)) ~'this ~(name meth)))
I’ve never looked at it. what looks unsafe?
it mutates the method map for the proxy, and for the duration of (call) it seems like any callers of that method on the proxy, would get the superclass's method instead
(is how I read i t, but I haven't looked in the guts of proxy in a while, and it seems crazy that it wouldn't be threadsafe, so I must be missing something)
well, I didn’t exhaustively through all the code, but at a glance, that seems correct
I mean your analysis seems correct that is
although I’m not sure it’s possible for that method to be in the proxy in first place as you can’t proxy super methods
I don't entirely follow that last bit, I have a (not very small) test case https://gist.github.com/hiredman/a42f83c2708bf6291a75c9372ad26525 that seems to demonstrate the thread unsafe behavior