Skip to content

Commit

Permalink
Revert "README: warn on prefer-method: link TNS-23"
Browse files Browse the repository at this point in the history
This reverts commit 57e5658.

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.
  • Loading branch information
Stuart Sierra committed Sep 19, 2014
1 parent 09e1e1f commit 27194f2
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 21 deletions.
13 changes: 0 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------------------------------------
Expand Down Expand Up @@ -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


Expand Down
2 changes: 1 addition & 1 deletion src/main/clojure/clojure/tools/namespace/dir.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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))))
Expand Down
4 changes: 1 addition & 3 deletions src/main/clojure/clojure/tools/namespace/file.clj
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,14 @@
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."
[tracker files]
(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
Expand Down
4 changes: 0 additions & 4 deletions src/main/clojure/clojure/tools/namespace/reload.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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))))
Expand Down

0 comments on commit 27194f2

Please sign in to comment.