If you refer a var from another namespace, then you can def a new value for that var, and the def will mutate the other namespace, and other things will go wrong as illustrated in the example below.
FWIW, Clojure disallows this, and refuses to allow you to evaluate a def involving a referred var, and emits an error diagnostic like:
Here is a complete example illustrating the issues:
Given:
then do this in a REPL:
Environment
None
Attachments
3
Activity
Show:
Mike Fikes July 16, 2018 at 4:28 PM
CLJS-1558-3.patch rebaselines
Mike Fikes July 2, 2018 at 6:14 PM
CLJS-1558-2.patch rebaselines
Mike Fikes November 27, 2017 at 8:05 PM
Here is an example showing that it is (as was before), OK to define a Var that shadows a core Var:
Mike Fikes November 27, 2017 at 8:00 PM
The attached patch essentially turns the warning into an error for non-core names, throwing an exception that matches Clojure's.
If you refer a var from another namespace, then you can def a new value for that var, and the def will mutate the other namespace, and other things will go wrong as illustrated in the example below.
FWIW, Clojure disallows this, and refuses to allow you to evaluate a def involving a referred var, and emits an error diagnostic like:
Here is a complete example illustrating the issues:
Given:
then do this in a REPL: