Sibi
Sibi

Reputation: 48654

clojure require works with parenthesis

I was just playing around with Clojure (Version 1.1.0) and found this behavior quite odd:

user=> (in-ns 'greet)
#<Namespace greet>
greet=> (clojure.core/require 'clojure.core)
nil
greet=> (clojure.core/require 'clojure.string)
java.io.FileNotFoundException: Could not locate clojure/string__init.class or clojure/string.clj on classpath:  (NO_SOURCE_FILE:0)
greet=> (clojure.core/require '(clojure.string))
nil

When I use the require function, it works with 'clojure.core, but doesn't work with 'clojure.string and works with '(clojure.string). Why does this happen ?

Upvotes: 1

Views: 124

Answers (1)

Joost Diepenmaat
Joost Diepenmaat

Reputation: 17773

You're using a years old version of clojure (which AFAIK doesn't even have clojure.string included). Your example code works perfectly fine in current clojure 1.5.1

Upvotes: 3

Related Questions