Permalink
Browse files

forgot deftype-once

  • Loading branch information...
1 parent 8649792 commit e8d05ed920f185213ec62983c863cc87c7765fea @ztellman committed Apr 22, 2012
Showing with 8 additions and 1 deletion.
  1. +1 −1 src/potemkin.clj
  2. +7 −0 src/potemkin/protocols.clj
View
@@ -23,7 +23,7 @@
(import-fn macros/transform-fn-bodies)
(import-macro protocols/defprotocol-once)
-
+(import-macro protocols/deftype-once)
@@ -15,6 +15,13 @@
`(do)
(list* 'defprotocol name body)))
+(defmacro deftype-once
+ "defonce for deftype"
+ [name & body]
+ (if (resolve name)
+ `(do)
+ (list* 'deftype name body)))
+
(defprotocol-once PotemkinMap
(keys* [this data]))

0 comments on commit e8d05ed

Please sign in to comment.