Skip to content

Instantly share code, notes, and snippets.

@mefesto
Created July 28, 2011 20:20
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 mefesto/1112451 to your computer and use it in GitHub Desktop.
Save mefesto/1112451 to your computer and use it in GitHub Desktop.
(deftype MyType [x]
clojure.lang.IFn
(invoke [this y]
(+ x y)))
user> (def z (MyType. 2))
#'user/z
user> (z 3)
5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment