Created
December 18, 2011 22:53
-
-
Save samaaron/1494730 to your computer and use it in GitHub Desktop.
Clojure: infoke overloading
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defrecord Foo [fn-impl] | |
clojure.lang.IFn | |
(invoke [this] (fn-impl)) | |
(invoke [this a] (fn-impl a)) | |
(invoke [this a b] (fn-impl a b)) | |
(invoke [this a b c] (fn-impl a b c)) | |
(invoke [this a b c d] (fn-impl a b c d)) | |
(invoke [this a b c d e] (fn-imple a b c d e)) | |
(invoke [this a b c d e f (fn-impl a b c d e f)]) | |
(invoke [this a b c d e f g (fn-impl a b c d e f g)]) | |
(invoke [this a b c d e f g h (fn-impl a b c d e f g h)]) | |
(invoke [this a b c d e f g h i (fn-impl a b c d e f g h i)]) | |
;;clearly needs a macro to continue... | |
(applyTo [this arg-list] (clojure.lang.AFn/applyToHelper fn-impl arg-list))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment