From 27194f2edfe3f5f9e1343f993beca4b43f0bafe8 Mon Sep 17 00:00:00 2001 From: Stuart Sierra Date: Fri, 19 Sep 2014 16:32:25 -0400 Subject: [PATCH] Revert "README: warn on prefer-method: link TNS-23" This reverts commit 57e5658c8d9154711979019d85b279ad5f6898c9. This commit was a mistake: it included work-in-progess development which was not ready for release. Only the README change should have been included. --- README.md | 13 ------------- src/main/clojure/clojure/tools/namespace/dir.clj | 2 +- src/main/clojure/clojure/tools/namespace/file.clj | 4 +--- src/main/clojure/clojure/tools/namespace/reload.clj | 4 ---- 4 files changed, 2 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index fa5bb92..a4513a8 100644 --- a/README.md +++ b/README.md @@ -453,15 +453,6 @@ To avoid this problem, always create new instances of records after a refresh. -### Warnings for Multimethods - -Calling `prefer-method` is a global side-effect. If you modify a call -to `prefer-method` and reload the namespace containing it, Clojure may -throw "java.lang.IllegalStateException: Preference conflict in multimethod." -The workaround is to call `remove-method` before reloading. -tools.namespace cannot detect this situation automatically. See [TNS-23]. - - Change Log ---------------------------------------- @@ -568,10 +559,6 @@ Change Log [TNS-17]: http://dev.clojure.org/jira/browse/TNS-17 [TNS-18]: http://dev.clojure.org/jira/browse/TNS-18 [TNS-19]: http://dev.clojure.org/jira/browse/TNS-19 -[TNS-20]: http://dev.clojure.org/jira/browse/TNS-20 -[TNS-21]: http://dev.clojure.org/jira/browse/TNS-21 -[TNS-22]: http://dev.clojure.org/jira/browse/TNS-22 -[TNS-23]: http://dev.clojure.org/jira/browse/TNS-23 [java.classpath]: https://github.com/clojure/java.classpath diff --git a/src/main/clojure/clojure/tools/namespace/dir.clj b/src/main/clojure/clojure/tools/namespace/dir.clj index ac00f0a..9f9b0f1 100644 --- a/src/main/clojure/clojure/tools/namespace/dir.clj +++ b/src/main/clojure/clojure/tools/namespace/dir.clj @@ -35,7 +35,7 @@ (let [now (System/currentTimeMillis)] (-> tracker (update-in [::files] #(if % (apply disj % deleted) #{})) - (file/remove-files (into deleted modified)) + (file/remove-files deleted) (update-in [::files] into modified) (file/add-files modified) (assoc ::time now)))) diff --git a/src/main/clojure/clojure/tools/namespace/file.clj b/src/main/clojure/clojure/tools/namespace/file.clj index 430e5ac..a345622 100644 --- a/src/main/clojure/clojure/tools/namespace/file.clj +++ b/src/main/clojure/clojure/tools/namespace/file.clj @@ -42,8 +42,6 @@ m)) {} files)) -(def ^:private merge-map (fnil merge {})) - (defn add-files "Reads ns declarations from files; returns an updated dependency tracker with those files added." @@ -51,7 +49,7 @@ (let [{:keys [depmap filemap]} (files-and-deps files)] (-> tracker (track/add depmap) - (update-in [::filemap] merge-map filemap)))) + (update-in [::filemap] (fnil merge {}) filemap)))) (defn remove-files "Returns an updated dependency tracker with files removed. The files diff --git a/src/main/clojure/clojure/tools/namespace/reload.clj b/src/main/clojure/clojure/tools/namespace/reload.clj index eecddba..4c09b83 100644 --- a/src/main/clojure/clojure/tools/namespace/reload.clj +++ b/src/main/clojure/clojure/tools/namespace/reload.clj @@ -34,10 +34,6 @@ (let [n (first load)] (try (require n :reload) (update-in tracker [::track/load] rest) - ;; This doesn't work because we don't ever try to reload the file. - ;; (catch java.io.FileNotFoundException e - ;; (assoc tracker - ;; ::error e ::error-ns n ::track/load (rest load))) (catch Throwable t (assoc tracker ::error t ::error-ns n ::track/unload load))))