Created
April 2, 2019 18:06
-
-
Save djtango/6bc2115069bbb9328f37b55feb0dfa60 to your computer and use it in GitHub Desktop.
fn-name
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
(ns fn-name | |
(:require [clojure.main])) | |
;; https://stackoverflow.com/questions/22116257/how-to-get-functions-name-as-string-in-clojure | |
(defn fn-name | |
[f] | |
(as-> (str f) $ | |
(clojure.main/demunge $) | |
(or (re-find #"(.+)--\d+@" $) | |
(re-find #"(.+)@" $)) | |
(last $))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment