Skip to content

Instantly share code, notes, and snippets.

@zippy
Created March 10, 2011 03: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 zippy/863513 to your computer and use it in GitHub Desktop.
Save zippy/863513 to your computer and use it in GitHub Desktop.
clojure defmacro problem
(defprotocol T "test" (getclass [this]))
(extend-type clojure.lang.PersistentArrayMap T (getclass [this] (class this)))
(getclass {})
(defmacro makeT [klass] `(extend-type ~klass T (getclass [this] (class this))))
(makeT String)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment