How can I get the Clojurescript namespace I am in from within a clojurescript program?

后端 未结 4 752
长发绾君心
长发绾君心 2021-01-12 08:16

How can I get the Clojurescript namespace I am in from within a clojurescript program? I want to do this do provide certain debug information (it only needs to work in dev m

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-12 08:49

    Namespaces are not first class in ClojureScript as they are in Clojure. There's absolutely no way to get the namespace at runtime. It is possible to get this information at macroexpansion time if you're not afraid of accessing some the ClojureScript compiler internals. There should probably be an API for this - but we're not there yet.

提交回复
热议问题