This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-21
Channels
- # alda (1)
- # bangalore-clj (1)
- # beginners (7)
- # boot (88)
- # carry (2)
- # cider (8)
- # cljs-dev (60)
- # cljsjs (2)
- # cljsrn (45)
- # clojure (255)
- # clojure-belgium (5)
- # clojure-boston (1)
- # clojure-dusseldorf (3)
- # clojure-greece (49)
- # clojure-italy (10)
- # clojure-russia (30)
- # clojure-spec (78)
- # clojure-uk (11)
- # clojurebridge (1)
- # clojurescript (80)
- # cursive (14)
- # datomic (33)
- # defnpodcast (4)
- # devcards (2)
- # dirac (15)
- # editors (23)
- # emacs (5)
- # events (11)
- # funcool (1)
- # hoplon (1)
- # juxt (1)
- # luminus (2)
- # mount (7)
- # off-topic (15)
- # om (152)
- # om-next (2)
- # onyx (17)
- # parinfer (1)
- # proton (38)
- # re-frame (35)
- # reagent (110)
- # rum (3)
- # spacemacs (3)
- # specter (51)
- # test-check (2)
- # testing (5)
- # untangled (234)
CLJS-1507 related question, I wonder if there could be a macro which would collect all macro namespaces and macro method names and export them into generated cljs source as data. I need it for Dirac: https://github.com/binaryage/dirac/issues/39 A poor man’s solution would be something like http://clojure.github.io/tools.namespace/#clojure.tools.namespace.find/find-namespaces, and then read all the files and extract defmacro symbols, but that may not be reliable. It would be better to query cljs compiler’s clj environment for all loaded macros somehow.
when I use cljs.analyzer.api from some macro expanded in some cljs file, will it see “full picture” or just current state, that means all the code loaded/processed up to this point
I need holistic view and collect all macros from all namespaces and generate it into selected cljs as data
also the analyzer and compiler tests will be informative how this stuff actually works
I added a bunch of newbie friendly tasks today http://dev.clojure.org/jira/secure/IssueNavigator.jspa?mode=hide&requestId=10616 almost all of them are trivial clojure.spec stuff
@darwin I don't know if I understand correctly, but you can also check what replumb.ast
does: https://github.com/Lambda-X/replumb/blob/master/src/cljs/replumb/ast.cljs
If I do not understand correctly, apologies 😄
thanks, yes, that is what I need, list of all public macros from all available namespaces
in bootstrap you build it yourself, usually ..and you store it in an atom
https://github.com/Lambda-X/replumb/blob/master/src/cljs/replumb/repl.cljs#L27
then you pass it to all the calls to eval
or eval-str
...
I understand that in repl this gets built incrementally as user is executing commands in the repl, but I need this for user’s code when he includes my library
well, I guess in a require
right?
ah no wait, so you are aiming at already compiled code
that includes your lib
yes, my cljs file gets required somewhere in his project (typically via :preloads) and I want to grab all his macros at that point and export it as data for dirac to use
yes true
maybe naive idea: he requires dirac.runtime.cljs, I call my macro there, which in turn discovers all .clj files and requires them, it updates compiler env this way and now I can start using that env to ask analyzer questions about macros
I’m worried about that require part, that could cause a lot of troubles (requiring broken files on classpaths etc)
ok yes so everything is at runtime on already compiled javascript...it looks like you need bootstrapped cljs
I’m telling you, my runtime library will be included in his project during compilation
and I have to stay away from bootstrapped, cannot force people to setup their project to be bootstrap-compatible just for dirac
right ok
maybe an ok solution for me would be something like :postloads. having my namespace included “last"
I am checking in the cljs source if I can find a place when you can start digging
this way I would know that calling a macro at that point would be pretty ok, because env would contain all namespaces project used
yeah I don't know if there is something like that, David/Mike know more for sure 😄
yes that part was clear, you need a step in between
kind of like a macro step
but with your custom code
another really hacky idea is to force people to setup another build step, which will run in the same JVM
here is the compiler env
yeah, you need to intercept that *compile*
thing when it is still filled up with the analyzed data
macros work quite fine in Dirac right now, code completions are not that important for me burn more time on it
not sure, but curious to know, thanks for sharing 😉
and thanks for your cool work on Dirac I use it every day