My namespace declaration looks like this:
(ns test.foo
(:use
[clj-http.client :only (get) :as client]
[net.cgrand.enlive-html :only (select) :as html]))
It works fine in the REPL, the first time I use it. Then, when I modify the code and try the following in the REPL:
(use :reload 'test.foo)
I get:
java.lang.IllegalStateException: get already refers to: #'clj-http.client/get in namespace: test.foo (foo.clj:1)
I'm on windows with counterclockwise and also tried with leiningen (lein repl).
You should not shadow core fns by accident. You have to be explicit about your intent:
(ns test.foo
(:refer-clojure :exclude [get]) ; suppress the shadowing warning
(:require [clojure.core :as core]) ; allow to still reach clojure.core/get through core/get
(:use
[clj-http.client :only (get) :as client]
[net.cgrand.enlive-html :only (select) :as html]))
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