Skip to content

Instantly share code, notes, and snippets.

@pingles
Created April 18, 2011 19:21
Show Gist options
  • Save pingles/925980 to your computer and use it in GitHub Desktop.
Save pingles/925980 to your computer and use it in GitHub Desktop.
Example taken from Clojure.org
(defprotocol P
(foo [x])
(bar-me [x] [x y]))
(deftype Foo [a b c]
P
(foo [x] a)
(bar-me [x] b)
(bar-me [x y] (+ c y)))
user> (bar-me (Foo. 1 2 3) 42)
45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment