Reputation: 8654
Why does this work:
(ns image-test.core
(:gen-class)
(:require (png-extract)
[clojure.string :as string]))
but this fails:
(ns image-test.core
(:gen-class)
(:require [png-extract :as png]
[clojure.string :as string]))
I thought [] were always ok in require. Please edify.
Upvotes: 0
Views: 67
Reputation: 91857
(:require (png-extract))
is a no-op, "succeeding" by doing nothing. Using parens here means you're starting a prefix list, like (:require (clojure set string))
to require clojure.set
and clojure.string
; since you don't put any namespaces after the png-extract
, it's not requiring anything at all. Using []
s is correct, but it's failing because there's something wrong with the png-extract
namespace: perhaps it doesn't exist, or is broken in some way.
Upvotes: 2
Reputation: 91534
Here is an example using both forms:
image-test.core> (ns image-test.core
(:gen-class)
(require [clojure.string :as foo ]
[clojure.string :as string]))
nil
image-test.core> (ns image-test.core
(:gen-class)
(require (clojure.string)
[clojure.string :as string]))
Perhaps something with the png-extract dependency?
Upvotes: 1