Yes, this has been suggested in the past, and would enable all sorts of useful 
tooling features.

The off-the-top-of-my-head solution (a priori of a proper statement of the 
problem :-P would be for all namespaces (c.l.Namespace/namespaces) and each 
namespace's aliases and mappings to be held in atoms — which could then have 
watches set on them.  Each aliases and mappings are already held in 
AtomicReferences, so things are halfway there in a sense.

Along the same lines, there's been talk in the past of attempting to make 
loading code transactional.  At a minimum, this would imply using refs instead 
of atoms for the structures mentioned above, with each ns/require/use/load 
usage implying a dosync over the affected references.

There may well be bootstrapping issues with such changes.

- Chas

On Sep 15, 2011, at 9:03 AM, Stathis Sideris wrote:

> Hello,
> 
> Is it somehow possible to monitor all namespaces for new defs or re-
> defs (and defns etc). Generally, it it possible to implement some sort
> of notification whenever something is added or updated to a namespace?
> I don't mind even the solution is hacky or not very fast.
> 
> The reason I'm asking is because such functionality would be very
> useful for creating development tools that would react to the
> developer eval-ing a function or re-compiling a file etc.
> 
> Thanks,
> 
> Stathis
> 
> -- 
> 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 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

Reply via email to