This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-30
Channels
- # arachne (5)
- # beginners (42)
- # cider (35)
- # cljs-dev (25)
- # cljsrn (2)
- # clojure (107)
- # clojure-dev (32)
- # clojure-finland (2)
- # clojure-greece (3)
- # clojure-italy (6)
- # clojure-nl (7)
- # clojure-spec (27)
- # clojure-uk (45)
- # clojurescript (152)
- # core-async (3)
- # cursive (26)
- # data-science (4)
- # datomic (33)
- # defnpodcast (1)
- # duct (12)
- # editors (3)
- # emacs (6)
- # events (5)
- # fulcro (6)
- # jobs (1)
- # lein-figwheel (9)
- # off-topic (7)
- # onyx (7)
- # re-frame (1)
- # reagent (9)
- # reitit (31)
- # shadow-cljs (130)
- # slack-help (1)
- # spacemacs (53)
- # tools-deps (55)
- # yada (4)
cljs.analyzer.api/ns-publics
returns macros with additional &form
& &env
arguments — if anyone has a moment could you explain why that is and if these arguments might be relevant for user-facing documentation in any way?
Specifically I’m using codox (with some mods) to read ns publics. The current setup returns macros twice, once as returned by cljs.analyzer.api
and once read from the Clojure side
I’m trying to work out which of these two are more appropriate to use as input for documentation
Some macros are in core.cljc
solely for self-hosted.
One recent change (for doto
) illustrates that it is there only so that it has a docstring relevant to ClojureScript / JavaScript.
Oh, I’m asking for any cljs/c code not just core. Not sure if that makes a difference?
Are macros that are returned by ns-publics generally the versions for self hosted?
@martinklepsch you need to clarify a bit what you mean
yes pretty much. I’m unsure how/if that should translate into docs somehow or if I should just ignore macros that are returned by cljs.analyzer.api/ns-publics
because as far as I understand macros in cljs are usually just clj macros right (ignoring self-hosting here)
I think that might be the case
it seems that when the macro arglist includes something like & body
the arglist returned by ns-publics includes &form &env
@dnolen https://dev.clojure.org/jira/browse/CLJS-2852 — Let me know if this needs more info
(doto (defmacro with-config-override [opts & body]
`(with-config-override* ~opts (fn [] ~@body)))
(alter-meta! assoc :arglists '([{:keys [switches secret-keys override-switches] :as opts-override} & body])))
this also results in different arglists — clj has the updated one — is that expected?ok, will do
So just for my immediate need:
- given I have the clj and cljs publics for a namespace available
- is there any reason for me to care about the macros as returned by cljs-publics?
- as far as I understand macros clj/cljs ns-publics
macros should always be equal? i.e. (= (filter macro? clj-ns-publics) (filter macro? cljs-ns-publics))
Ok so I’ll just ignore macros returned from cljs ns-publics
for now and instead use the info returned from clojure’s ns-publics