Last active
December 25, 2015 01:09
-
-
Save mhaemmerle/6893036 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 a) | |
(def ^:dynamic *p* nil) | |
(defprotocol P | |
(f [this])) | |
(deftype Foo [] | |
P | |
(f [this] | |
...)) | |
(deftype Bar [] | |
P | |
(f [this] | |
...)) | |
(alter-var-root #'*p* (fn [_] (Foo.))) | |
(ns b | |
(:use [a])) | |
(f a/*p*) | |
(ns c | |
(:use [a])) | |
(f a/*p*) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(deftype Foo
P
(f [this]
...))
(deftype Bar
P
(f [this]
...))