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.

Reply via email to