# Get the name of a function in the argument

**URL:** https://discourse.julialang.org/t/get-the-name-of-a-function-in-the-argument/40027
**Category:** New to Julia
**Tags:** argument, function
**Created:** [May 23, 2020, 3:53pm UTC](https://discourse.julialang.org/t/get-the-name-of-a-function-in-the-argument/40027 "2020-05-23T15:53:03Z")
**Posts on this page:** 1
**Showing post:** 10

<div class="post-metadata">

### Author: ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)
#### Post date: [July 26, 2020, 7:46pm UTC](https://discourse.julialang.org/t/get-the-name-of-a-function-in-the-argument/40027/10 "2020-07-26T19:46:38Z")

</div>

You may find interesting this macro that prints the name of the current function it is called from:

> [@How to print function name and source file/line number](https://discourse.julialang.org/t/how-to-print-function-name-and-source-file-line-number/43486):
>
> Hello, is it possible to print the current function name and the REPL/Juno/VSCode clickable file name/function name, e.g. function foo() @codeLocation ... end Resulting in: Running function foo on /path/to/myfile.jl:123 I am aware of \_\_source\_\_.file and \_\_source\_\_.line, but I coudn’t get them working in the way I described and the function @shown in [DebuggingUtilities](https://github.com/timholy/DebuggingUtilities.jl) seems to go a bit too far showing the whole stack. EDIT: I did manage to get the file name/ line but not yet the fu…

---

_[View the full topic](https://discourse.julialang.org/t/get-the-name-of-a-function-in-the-argument/40027)._
