Created
December 3, 2010 17:48
-
-
Save fogus/727273 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defprotocol Foo (bar [x]) (baz [x])) | |
(extend-type String Foo (bar [x] "bar")) | |
(extend-type String Foo (baz [x] "baz")) | |
(baz "a") | |
;=> "baz" | |
(bar "a") | |
; IllegalArgumentException No implementation of method: :bar of protocol: #'user/Foo found for class: java.lang.String clojure.core/-cache-protocol-fn (core_deftype.clj:471) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment