7
votes

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?

2

2 Answers

15
votes

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.

3
votes

The idiomatic way is:

(ns myproject.hello

(:use myproject.world))