diff options
Diffstat (limited to 'src/boot.clj')
-rw-r--r-- | src/boot.clj | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/boot.clj b/src/boot.clj index 034389c2..cdb58644 100644 --- a/src/boot.clj +++ b/src/boot.clj @@ -504,9 +504,13 @@ (when (. clojure.lang.Var (find (sym (str *current-namespace*) (str name)))) (throw (new Exception (strcat "Name conflict: " name " already exists in this namespace")))) (let [varsym (sym (str ns) (str name)) - var (. clojure.lang.Var (find varsym))] + var (. clojure.lang.Var (find varsym)) + rvar ((. refers (get)) name)] (if var - (. refers (bindRoot (assoc (. refers (get)) name var))) + (if rvar + (when (not (eql? rvar var)) + (throw (new Exception (strcat "Name conflict: " name " already exists in this refer map as: " (. rvar sym))))) + (. refers (bindRoot (assoc (. refers (get)) name var)))) (throw (new Exception (strcat "Can't find Var: " varsym))))))))) (defn unrefer [& names] @@ -514,6 +518,9 @@ (dolist name names (. refers (bindRoot (dissoc (. refers (get)) name)))))) +(defn unintern [varsym] + (. clojure.lang.Var (unintern varsym))) + (def *exports* '(clojure load-file eql-ref? @@ -537,6 +544,6 @@ map mapcat filter take take-while drop drop-while cycle split-at split-with repeat replicate iterate dolist - eval import unimport refer unrefer in-namespace + eval import unimport refer unrefer in-namespace unintern )) |