Last active
October 6, 2016 01:41
-
-
Save timsgardner/be31684a495778ab7095d6ccf0fc0b6c to your computer and use it in GitHub Desktop.
protocols test
This file contains hidden or 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 IBlubso | |
(flubmo [this])) | |
(def c1 (clojure.lang.RT/classForName "user.IBlubso")) | |
(defn blubber [] | |
(reify user.IBlubso | |
(flubmo [this] | |
:hi-there))) | |
(flubmo (blubber)) | |
;; => | |
;; :hi-there | |
(defprotocol IBlubso | |
(flubmo [this])) | |
(def c2 (clojure.lang.RT/classForName "user.IBlubso")) | |
(flubmo (blubber)) | |
;; => | |
;; System.NullReferenceException: Object reference not set to an instance of an object.. | |
(= c1 c2) | |
;; false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment