On Tuesday 16 December 2008 15:05, Allen Rohner wrote: > > On Dec 16, 4:32 pm, Stuart Halloway wrote: > > > Hi all, > > > > > > I sometimes need to (re)load a library, removing public symbols > > > from previously loaded version of the same lib: > > > > > > (defmacro ns-reload > > > `(do > > > (if (find-ns '~ns) > > > (doseq [s# (keys (ns-publics '~ns))] (ns-unmap '~ns s#))) > > > (require :reload-all '~ns))) > > > > > > ... > > > > > > Cheers, > > > Stuart > > > > > > ... > > > > On Dec 16, 4:55 pm, Stuart Sierra <the.stuart.sie...@gmail.com> wrote: > > I would find this useful; I've even tried writing it in the past. > > Perhaps it could go in clojure.contrib.ns-utils. > > > > ... > > > > -the other Stuart (Sierra) > > > > I'm also interested in having this utility. After it works, the next > thing I would write is (ns-reload-all!), which reloads everything.
Trying to create a home-away-from-home? A place you never have to leave?? Seeking to never shut down your Emacs-embedded REPL??? Anyway, I, too, find bulk / pervasive namespace reload interesting. If it's to be used for very-long- running (dynamic / interactive) Clojure applications, then it will be important to make sure that no unwanted references linger in places that can lead to unrecoverable heap storage. It seems to me that to be a completely general facility, some root data value bindings might require special roll-over logic (to propagate an existing value across a namespace reload in non-trivial ways), lest root defs for non-functions and -macros always revert to their initial values. > Allen Randall Schulz --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---