Last active
September 2, 2016 09:36
-
-
Save alandipert/cd2a82de8be3ba7cdc09e18d3904d360 to your computer and use it in GitHub Desktop.
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
(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