Skip to content

Instantly share code, notes, and snippets.

@swannodette
Created January 25, 2012 05:48
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swannodette/1674971 to your computer and use it in GitHub Desktop.
Save swannodette/1674971 to your computer and use it in GitHub Desktop.
ifn.clj
;; 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