Skip to content

Instantly share code, notes, and snippets.

@alandipert
Last active September 2, 2016 09:36
Show Gist options
  • Save alandipert/cd2a82de8be3ba7cdc09e18d3904d360 to your computer and use it in GitHub Desktop.
Save alandipert/cd2a82de8be3ba7cdc09e18d3904d360 to your computer and use it in GitHub Desktop.
(require '[clojure.repl :as repl])
(defmacro &this []
`(->> (Exception.)
.getStackTrace
(map bean)
(filter #(= "invoke" (:methodName %)))
(map #(read-string (repl/demunge (:className %))))
(keep resolve)
first))
(defn say-hello []
((fn []
(println "inside" (&this))))
(println "hello, bob"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment