Skip to content

Instantly share code, notes, and snippets.

@mhaemmerle
Last active December 25, 2015 01:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhaemmerle/6893036 to your computer and use it in GitHub Desktop.
Save mhaemmerle/6893036 to your computer and use it in GitHub Desktop.
(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*)
@noonian
Copy link

noonian commented Oct 8, 2013

(deftype Foo
P
(f [this]
...))

(deftype Bar
P
(f [this]
...))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment