I define namespace inside a clojure lib without ',
(ns myproject.hello)
But, I use ' for using it.
(use 'myproject.hello)
Why is this? Is there any logic behind this? In gosh (dialect of scheme), I use without ' i.e. (use myproject) Why is this irregularity?
Short answer: ns
is a macro, so its arguments are not evaluated. use
is a function, so its arguments must be quoted to prevent the compiler from evaluating them.
The use/require functions were not part of the original design of Clojure, they got added by contributors. They are in need of an overhaul.
The idiomatic way is:
(ns myproject.hello
(:use myproject.world))
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