-
-
Save tomjack/3fbd7c6f776820639aa1 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
(ns bar) | |
(defprotocol Bar | |
(foo [b])) | |
(extend-protocol Bar | |
String | |
(foo [s] "bar!")) | |
(ns baz) | |
(defprotocol Baz | |
(foo [b])) | |
(extend-protocol Baz | |
String | |
(foo [s] "baz!")) | |
user> (bar/foo "") | |
"bar!" | |
user> (baz/foo "") | |
"baz!" | |
user> (.foo "") | |
No matching field found: foo for class java.lang.String | |
[Thrown class java.lang.IllegalArgumentException] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment