With apologies for spamming: Solutions that involves installing a new lein plugin is fine too.
I'm willing to completely re-organize my workflow in order to * have some other piece of Clojure code gets called / do verification whenever a clojure namespace is required/loaded/reloaded / Done spamming. On Tue, Feb 18, 2014 at 8:38 PM, t x <txrev...@gmail.com> wrote: > As a point of clarification, read-string is not a hard requirement. > Just getting the name of the namespace (and walking through the > symbols + calling source on each of them to get the source code is > perfeclty fine). > > Basically, I want to hook a function that > * gets called every time a namespace is loaded/required/reloaded > * gets passed the namespace > > Thanks! > > On Tue, Feb 18, 2014 at 8:32 PM, t x <txrev...@gmail.com> wrote: >> Hi, >> >> Although solutions not involving cljx are perfectly fine, I'm using >> cljx -- so solutions that involves hooking into cljx are perfectly >> fine too. >> >> I have my own "poor-man's lint / type checker" (with different >> objectives from core.typed). I want a certain function (call it >> CHECKER) to be called every time a namespace has been "required / >> loaded / reloaded" >> >> Every time I require/load/reload a namespace, I want the following to >> happen: >> >> (CHECKER ... source code of the namesapce) >> >> i.e. something like >> >> (CHECKER (read-string "namesapce-just-loaded.clj")) >> >> Then, if CHECKER throws an exception, it should be a compile error. If >> CHECKER prints stuff out, it should go into the "lein repl" stdout, >> and if CHECKER doesn't do anything, it's assumed that the namespace >> passed the check. >> >> Is there a minimal example somewhere of how this works? (i.e. >> something as stupid as: "this example calls a function, which just >> prints out the name of all functions defined" would be extremely >> helpful). >> >> Thanks! -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.