Skip to content

Instantly share code, notes, and snippets.

@peteristhegreat
Last active October 29, 2018 18:42
Show Gist options
  • Save peteristhegreat/abccadcff4eb452760eb398a20fba1e7 to your computer and use it in GitHub Desktop.
Save peteristhegreat/abccadcff4eb452760eb398a20fba1e7 to your computer and use it in GitHub Desktop.
Julia getCurrentFunctionName
function __FUNC__()
split(split(string(stacktrace()[2]),"(")[1]," ")[1]
end
function some_long_function_name()
println("My function name is:", __FUNC__())
end
function other_long_function_name()
println("My function name is:", __FUNC__())
end
some_long_function_name()
other_long_function_name()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment