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, new definitions take effect after reload.

For example, in first case:
(ns a (require [b :as b-alias]))
(println b-alias/x) ; original value
; change sources of b or it's dependencies
(clojure.tools.namespace.repl/refresh)
(println b-alias/x) ; original value
; and also
(println b/x) ; new value

In second case:
(ns a (require [b]))
(println b/x) ; original value
; change sources of b or it's dependencies
(clojure.tools.namespace.repl/refresh)
(println b/x) ; new value

Can anyone explain why require acts like this? Does it mean that alias is 
not just naming change but some data structure in memory?

-- 
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/d/optout.

Reply via email to