The objectives are great. Perhaps I'm missing the forest for the trees though, as I don't see how they can all be met with the current set of abstractions at hand. The current implementation certainly isn't general-purpose (it's very tightly tied to a particular browser-REPL impl), but that aside, I don't see any clear route for a function-based implementation to work across different REPL environments. ClojureScript macros almost definitionally have privileged access to the compiler/analyzer/etc; the browser-REPL can only get around this because it has a persistent side-channel to the compiler host as an implementation detail. Rhino could be made to work as well, but only because it's in-process. Something like node-cljsrepl would have a very hard time supporting `clojure.reflect` without e.g. adding a method to IJavaScriptEnv or another protocol that implied reflection capability to offer a similar side-channel. (Not actually proposing anything here, just thinking aloud about what the distance might be between here and a complete solution.)
All that said, I'm happy to carry the reflection functionality along with the improved browser-REPL. But, if my assessment above is essentially accurate, my secondary proposal would be to at least put the user-facing reflection functions into something that indicates their implementation limits/targets (cljs.repl.browser.reflect? — similar to the clojure.java.* arrangement), which can later just delegate to `clojure.reflect` bits if and when a general contract is settled and "clojure.reflect" is indeed where fns like `doc` and `macroexpand` are to live in ClojureScript.
Thanks,
- Chas