Skip to content

Instantly share code, notes, and snippets.

@richhickey
Created November 29, 2009 18:16
Show Gist options
  • Save richhickey/244998 to your computer and use it in GitHub Desktop.
Save richhickey/244998 to your computer and use it in GitHub Desktop.
(reify
[ActionListener
(actionPerformed [this evt] ...)])
(deftype ::MyType [a b c]
[SeqableProtocol
(seq-me [this] (blah a c))]
[IBarInterface
(.bar [this that] (fred b))])
;above deftype becomes this when SeqbleProtocol has AOT-generated interface
(deftype ::MyType [a b c]
[my.ns.SeqableProtocol
(.seq_me [this] (blah a c))]
[IBarInterface
(.bar [this that] (fred b))])
;or these when not
(deftype ::MyType [a b c]
[IBarInterface
(.bar [this that] (fred b))])
;and
(extend-type ::MyType [a b c]
[SeqableProtocol
(seq-me [#^MyType__27 this]
(let [a (.a this)
b (.b this)
c (.c this)]
(blah a c)))])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment