Open LeifAndersen opened 3 years ago
(In the case of this specific bug, it seems to be expanding to a dynamic call to cljs.core.js_fn_QMARK_
, which is undefined. (Which I guess makes sense as js-fn?
is a macro and not a function.)
Hello @LeifAndersen,
I had the same problem with the js-fn? macro. But this is unrelated to your oops library issue. The problem is that [[https://cljs.github.io/api/cljs.core/js-fnQMARK][js-fn?]] (used in some namespace in oops) requires Clojurescript 1.10.844 and above. And you are most probably using an older clourescript version.
Concerning the usage for ocall, for me the following worked:
(ocall!+ (get-js-obj) "ellipse" x y w h) ;; Where "ellipse" is the function name of a js object, and arguments x, y, w, ;; and h are integers, in this particular case. Note, however, for some arguments, ;; like sequences, I had to use function clj->js to make it work.
If that doesn't help: The above example came from a proof of concept I wrote using the p5.js library (former processing.js graphics library). I managed to make it work with figwheel-main (for hot-reloading) and even make advance compilation work for a small example (thanks to oops library). You could check that out [[https://gitlab.com/nicolaus1990/cljs-examples/-/tree/master/p5_examples/p5-example-2][here]], if you think that might help.
... requires Clojurescript 1.10.844 and above. And you are most probably using an older clourescript version.
At the time of opening this issue, I was running: 1.10.872 (I have since upgraded to 1.10.932).
Concerning the usage for ocall, for me the following worked:
I'll try it out, thanks for the suggestion.
Right now there doesn't seem to be any docs on how to use ocall...and I can't seem to figure it out by trial and error myself.
I'm trying to translate:
(.call (oget % "getDoc") %)
to useocall
, with no success. I've tried things such as:(ocall % "getDoc")
,(ocall % "getDoc" %)
,(ocall % ("getDoc"))
,(ocall "getDoc" %)
, etc.I would imagine the first one is what I should be using. But since there's no documentation I can't tell if its breaking because I'm using it wrong, or because of some other error.