Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 mode)

like image 545
yazz.com Avatar asked May 20 '13 19:05

yazz.com


1 Answers

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.

like image 145
dnolen Avatar answered Sep 18 '22 06:09

dnolen