Skip to content

Commit

Permalink
[#793] Use a uuid in the implementation of defmethods
Browse files Browse the repository at this point in the history
  • Loading branch information
jfacorro committed May 29, 2021
1 parent 5c54a90 commit 6505256
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/clj/clojure/core.clje
Original file line number Diff line number Diff line change
Expand Up @@ -1493,7 +1493,8 @@
"Creates and installs a new method of multimethod associated with dispatch-value. "
{:added "1.0"}
[^clojerl.Symbol multifn dispatch-val & fn-tail]
(let [fn-name (gensym (str (.name multifn) "_method_"))]
(let [uuid (erlang.util.UUID/random)
fn-name (symbol (str (.name multifn) "_method_" uuid))]
`(do
(defn- ~fn-name ~@fn-tail)
(clj_multimethod/add_method ~multifn ~dispatch-val ~fn-name))))
Expand Down

0 comments on commit 6505256

Please sign in to comment.