14

私の名前空間宣言は次のようになります。

(ns test.foo
  (:use 
    [clj-http.client :only (get) :as client]
    [net.cgrand.enlive-html :only (select) :as html]))

初めて使用する REPL で問題なく動作します。次に、コードを変更して REPL で次のことを試してみます。

(use :reload 'test.foo)

私は得る:

java.lang.IllegalStateException: get already refers to: #'clj-http.client/get in namespace: test.foo (foo.clj:1)

私は反時計回りのウィンドウを使用しており、leiningen(lein repl)も試しました。

4

1 に答える 1

9

誤ってコアfnsをシャドウイングしないでください。あなたは自分の意図について明確にする必要があります:

(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]))
于 2011-01-10T16:40:40.263 に答える