tags:

views:

108

answers:

2

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?

+10  A: 

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.

Stuart Sierra
+1  A: 

The idiomatic way is:

(ns myproject.hello

(:use myproject.world))

Nicolas Oury