This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-08
Channels
- # aws (9)
- # beginners (69)
- # boot (14)
- # cider (26)
- # cljs-dev (56)
- # cljsrn (9)
- # clojars (4)
- # clojure (229)
- # clojure-brasil (1)
- # clojure-france (11)
- # clojure-greece (2)
- # clojure-italy (4)
- # clojure-mke (6)
- # clojure-serbia (6)
- # clojure-spec (83)
- # clojure-uk (38)
- # clojurescript (171)
- # core-async (3)
- # cursive (11)
- # data-science (11)
- # datomic (27)
- # emacs (113)
- # funcool (6)
- # hoplon (4)
- # jobs (1)
- # luminus (13)
- # lumo (44)
- # off-topic (148)
- # onyx (5)
- # overtone (1)
- # pedestal (4)
- # powderkeg (1)
- # proton (2)
- # re-frame (150)
- # reagent (16)
- # ring-swagger (43)
- # spacemacs (4)
- # specter (36)
- # vim (4)
- # yada (10)
this might not be lumo-specific, but I tried using cljs.js/eval
(as described here: http://blog.fikesfarm.com/posts/2016-01-22-clojurescript-eval.html), and while it evaluates my var correctly, it also warns about no such namespace
and use of undeclared var
. Furthermore, I get errors if I pass a bare symbol into eval instead of a fully qualified one
@moxaj do you mean the specific examples in that blog post?
@moxaj I’m busy now, but can you open an issue that I can investigate later?
thanks!
not really, IIRC
it does some fancy stuff to support it I think: https://github.com/mfikes/planck/blob/master/planck-cljs/src/planck/repl.cljs#L1692-L1722
and we may have to do the same in Lumo
IDK, can you show me some examples of what you’re trying to do?
but Lumo has no support for eval
^ it’s planned, but hasn’t landed yet
I don’t know. Maybe you could even put together a PR I can look at, since you’ve done the work?
Based on “undeclared var” warnings, my only hunch is that this needs to be hooked in, as in on this line https://github.com/mfikes/planck/blob/master/planck-cljs/src/planck/repl.cljs#L1743
I thought that was implicit
clearly I shouldn’t make any assumptions
sorry!
That’s because it happens to turn in to JavaScript that references things that exist. Even though the analyzer isn’t happy, at runtime things are OK.
The analyzer is what is emitting the warnings. It is effectively checking that things being used are defined.
Another example of that is at http://blog.fikesfarm.com/posts/2015-06-10-analyze-path-ftw.html where foo.bar/square
is used even without analysis info
@mfikes I see. Originally, I wanted to see if I could eval stuff at compile time, in both clojure, jvm clojurescript and self hosted. So unless I have access to some compiler state (which I don't), I have to live with the warnings?
@moxaj you can use lumo.repl/st
@moxaj FWIW on Planck's high level structure: planck.repl/eval
uses planck.repl/st
and is reused to implement other things (like resolve
and intern
), but it is primarily exposed via the publicly-facing planck.core/eval
The only corner case that I believe hasn't yet been satisfactorily resolved is https://github.com/mfikes/planck/issues/288