Created
January 25, 2012 05:48
-
-
Save swannodette/1674971 to your computer and use it in GitHub Desktop.
ifn.clj
This file contains 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
;; In Clojure/Script you can easily construct types which act like functions | |
(deftype ImmaFnish [s] | |
IFn | |
(-invoke [this n] [s n])) | |
(map (ImmaFnish. :yeah!) [1 2 3]) ;; ([:yeah! 1] [:yeah! 2] [:yeah! 3]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment