Re: How to migrate definitions to another namespace ?

2009-08-30 Thread Adrian Cuthbertson
Is there a way to unregister some names from a namespace without reloading it ? This is a bit trickier than one might think. An example illustrates this; Given two files, a.clj... (ns a) (defn stuff-a [] :stuff-a) (defn hello [] :hello) And b.clj... (ns b) (defn stuff-b [] :stuff-b) Say we

Re: How to migrate definitions to another namespace ?

2009-08-29 Thread Vagif Verdi
Thx to all. ns-unmap and remove-ns are what i need. From my CL experience i was looking for something like unitern. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: How to migrate definitions to another namespace ?

2009-08-29 Thread Laurent PETIT
Could some kind of :force true flag be generally interesting for the def special form ? (:force true would force an unmap first, if necessary) 2009/8/29 Vagif Verdi vagif.ve...@gmail.com Thx to all. ns-unmap and remove-ns are what i need. From my CL experience i was looking for something

How to migrate definitions to another namespace ?

2009-08-28 Thread Vagif Verdi
I often refactor my code and move some functions to new modules. Unfortunately i cannot load them, because clojure says that function with such name is already loaded from another namespace. I could not find nothing better but to close my clojure session (which means bring down the web server)

Re: How to migrate definitions to another namespace ?

2009-08-28 Thread J. McConnell
On Aug 28, 2009, at 11:55 PM, Vagif Verdi vagif.ve...@gmail.com wrote: I often refactor my code and move some functions to new modules. Unfortunately i cannot load them, because clojure says that function with such name is already loaded from another namespace. I could not find nothing

Re: How to migrate definitions to another namespace ?

2009-08-28 Thread Timothy Pratley
How about something like this? user= (ns fun) fun= (defn myfun [] 1) fun= (defn myfun2 [] 1) fun= (keys (ns-publics 'fun)) (myfun myfun2) fun= (doseq [s (keys (ns-publics 'fun))] (ns-unmap 'fun s)) fun= (myfun) java.lang.Exception: Unable to resolve symbol: myfun in this context

Re: How to migrate definitions to another namespace ?

2009-08-28 Thread Mike Hinchey
I use (remove-ns 'my-ns), then reload the entire file. -Mike --~--~-~--~~~---~--~~ 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