Coder Social home page Coder Social logo

Comments (3)

LeifAndersen avatar LeifAndersen commented on June 15, 2024

(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.)

from cljs-oops.

nicolaus1990 avatar nicolaus1990 commented on June 15, 2024

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:
#+begin_src clojure
(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.
#+end_src

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.

from cljs-oops.

LeifAndersen avatar LeifAndersen commented on June 15, 2024

... 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.

from cljs-oops.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.