Re: How aliased "require" is different?

2014-06-25 Thread Ivan Kozik
I'm sending a corrected version of the wrapper, because the original doesn't show errors returned by (refresh), and these are actually critical. The corrected version: :init (do (require '[clojure.tools.namespace.repl :refer [refresh]]) (defn r [] (let [result (refresh)]

Re: How aliased "require" is different?

2014-05-04 Thread Petr Gladkikh
Thanks for the wrapper, that turned out to be the problem with 'user' namespace I was REPLing in (other namespaces were refreshed as expected). While resolving this I also found out that :after option of refresh function is indeed useful (my server was re-created with older version of ring handler

Re: How aliased "require" is different?

2014-05-04 Thread Ivan Kozik
Here's a wrapper over (refresh) that updates the aliases in the user namespace as well. You can put it in the :repl-options in your project.clj. :init (do (require '[clojure.tools.namespace.repl :refer [refresh]]) (defn r [] (refresh) ; https://github.com/cloju

Re: How aliased "require" is different?

2014-05-04 Thread Ivan Kozik
Hi Petr, Did you see this? https://github.com/clojure/tools.namespace#warnings-for-aliases Also mentioned: "Aliases to reloaded namespaces will break if the namespace containing the alias is not reloaded also." I've been writing per-project wrappers over the refresh function to do the ns-unalias

How aliased "require" is different?

2014-05-03 Thread Petr
Hello. I experienced non obvious behavior of "require namespace as alias" when using clojure.tools.namespace.repl/refresh. If I use aliased namespace then after changing source files and call to refresh I seem to have old values in that alias. If I use plain require all seem to work as expected