Skip to content

Instantly share code, notes, and snippets.

@jebberjeb
Created December 11, 2013 04:11
Show Gist options
  • Save jebberjeb/7904987 to your computer and use it in GitHub Desktop.
Save jebberjeb/7904987 to your computer and use it in GitHub Desktop.
(ns test-app.bar)
(defmulti do-it :foo)
(defmethod do-it "foo"
[m]
"foo'd it")
(defmethod do-it "bar"
[m]
"bar'd it")
(defmethod do-it :default
[m]
"default")
[((get-method do-it "bar") 'anything)
((get-method do-it "x") 'anything)]
;; => ["bar'd it" "default"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment