Skip to content

Instantly share code, notes, and snippets.

@timvisher
Created July 10, 2012 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timvisher/3085419 to your computer and use it in GitHub Desktop.
Save timvisher/3085419 to your computer and use it in GitHub Desktop.
(defn class* [a & _]
(class a))
(defmulti write-hotfix class*)
(defmethod write-hotfix clojure.lang.Ref [memory-store hotfix]
(dosync
(ref-set memory-store (assoc @memory-store (:id hotfix) hotfix))))
(write-hotfix (ref {}) {:id 1})
;;; =>
;; No method in multimethod 'write-hotfix' for dispatch value: clojure.lang.Ref@b2018c
;; [Thrown class java.lang.IllegalArgumentException]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment