Comments (3)
(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.
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.
... 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)
- How to use cljs-oops to access a constructor? HOT 3
- Literal dot in key HOT 1
- cljs-oops with methods that take arguments HOT 3
- Can't call methods on strings HOT 7
- Warnings with :checked-arrays :warn HOT 1
- Escaping special symbols HOT 3
- Diagnostics: check for frozen objects when attempting `oset` HOT 1
- oapply doesnt work for symbolic arguments HOT 1
- ocall interaction with *warn-on-infer* HOT 1
- Errors when executed over a prepl connection HOT 3
- Don't warn in `oset!` if var is `:const` HOT 1
- Error thrown when using oops with js/Date objects HOT 3
- Thanks for Oops! HOT 1
- oops + shadow-cljs 2.12 are not working together because of old GCL HOT 3
- goog.isDateLike is triggered by others' sketchy practices
- Runtime error - Resource: oops/core.cljs:42:3 - Use of undeclared Var cljs.core/js-fn? HOT 2
- oset being strict
- `oget` fails if the JS object has `:constructor` set to `null`
- Use of undeclared Var cljs.core/js-fn? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cljs-oops.