Last active
July 12, 2016 17:11
-
-
Save aperiodic/d3c466da51fb8b960fefe466ee203942 to your computer and use it in GitHub Desktop.
You Can Partially Implement Protocols
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]) | |
(baz [this])) | |
(let [fooer (reify Foo | |
(bar [_] :bar))] | |
(bar fooer)) | |
;; => :bar | |
(defservice foo-service | |
Foo | |
[] | |
(bar [this] :bar)) | |
;; CompilerException java.lang.IllegalArgumentException: Service does not define function 'baz', which is required by protocol 'Foo' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment