-
-
Save anonymous/3279a96dc760a63716ba1527ef88065e 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 [this])) | |
(extend-type clojure.lang.IPersistentMap | |
Foo | |
(bar [this] | |
"I'm a map")) | |
(extend-type java.lang.String | |
Foo | |
(bar [this] | |
"I'm a string")) | |
(bar {}) | |
;;=> "I'm a map" | |
(bar "") | |
;;=> "I'm a string" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment