clojurescript

ClojureScript, a dialect of Clojure that compiles to JavaScript http://clojurescript.org | Currently at 1.10.879
witek 2021-04-02T12:18:07.448900Z

I have a namespace with pure functions and no requires. Now I would like to write "Rich comments" in this namespace. But I would like to use definitions from an other namespace to reuse some test data. Is there a way to require/refer namespaces just in the (comment ...) block?

p-himik 2021-04-02T12:19:18.449Z

(require '[x :as y])

p-himik 2021-04-02T12:19:49.449200Z

Ah, sorry - didn't notice the channel is CLJS.

p-himik 2021-04-02T12:21:21.449400Z

(require ...) doesn't work in not self-hosted environments. But since the comment will probably be used only when working with a CLJS REPL, and there (require ...) might work, I'm not sure.

lilactown 2021-04-02T13:31:04.449800Z

require works in CLJS REPLs, just not at compile time

👍 1