Can any one give me a good example answer to differentiate between Use, Require and Import.
I hope someone can help me.
require
ensures that a Clojure namespace has been compiled and instantiated.
:reload
key:as
key is provided.:refer
key is provided. The mapping is only visible from inside the requiring namespace, and is not transitive to other namespaces requiring it.use
is identical to require in action, except that the default is to modify the current namespace via the refer
function to include all the target namespace's vars as if :refer :all
had been provided. It accepts the :exclude
, :only
, and :rename
keys to guide the modification of the current namespace.
import
is for adding mappings of Class names to the current namespace, so that the package qualifiers will not need to be used.
In short, use require
You'll almost never want to mix-up symbols from different namespaces in the same namespace the way use
does, except during casual REPL work.
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