I have a file like this
(ns boston.core)
If I (load "boston/core")
from the REPL, however, my *ns*
doesn't change to boston
but remains user
. Why is this?
This is because load just loads the specified file (into the boston.core namespace, as specified at the top of the file). It doesn't do anything to the current namespace in the REPL.
If you also want to switch namespace in the REPL to use whatever has just been loaded you need to do something like:
(load "boston/core")
(ns boston.core)
Note that "boston/core" has a slash because it refers to a file resource, whereas namespaces themselves use a dot as separators.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With