Skip to content

Instantly share code, notes, and snippets.

View BestFriendChris's full-sized avatar

Chris Turner BestFriendChris

  • San Francisco, CA
View GitHub Profile

Keybase proof

I hereby claim:

  • I am BestFriendChris on github.
  • I am BestFriendChris (https://keybase.io/BestFriendChris) on keybase.
  • I have a public key whose fingerprint is A9F4 3F6A 377D 69C8 0E0C 1F97 6164 DE8A 5DCC 0295

To claim this, I am signing this object:

@BestFriendChris
BestFriendChris / threading-fn.clj
Created January 22, 2011 06:36
Patch to support #(method %) and (fn [x] (method x)) in threading
(defmacro ->
"Threads the expr through the forms. Inserts x as the
second item in the first form, making a list of it if it is not a
list already. If there are more forms, inserts the first form as the
second item in second form, etc."
{:added "1.0"}
([x] x)
([x form] (cond
(and (seq? form) (#{'fn 'fn*} (first form)))
(with-meta `(~form ~x) (meta form))