Skip to content

Instantly share code, notes, and snippets.

@richhickey
Created November 29, 2009 18:16
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 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