Thread overview
[Issue 9306] __function alias
Feb 26, 2017
b2.temp@gmx.com
Mar 21, 2020
Basile-z
Aug 09, 2020
Dlang Bot
Sep 08, 2022
RazvanN
February 26, 2017
https://issues.dlang.org/show_bug.cgi?id=9306

b2.temp@gmx.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |b2.temp@gmx.com

--- Comment #1 from b2.temp@gmx.com ---
It's easy to do at the library level:

auto recursion(string Fun = __FUNCTION__ , A...)(auto ref A a)
{
    import std.typecons: tuple;
    mixin("return " ~ Fun ~ "(" ~ a.stringof ~ "[0..$]);");
}

used like this:

long factorial(long a)
{
    if (a <= 1)
        return a;
    else
        return a * recursion (a-1);
}

void main()
{
    auto a = factorial(20);
}

So maybe this one could be closed as WONTFIX ?

--
March 21, 2020
https://issues.dlang.org/show_bug.cgi?id=9306

Basile-z <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|b2.temp@gmx.com             |

--
August 09, 2020
https://issues.dlang.org/show_bug.cgi?id=9306

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #2 from Dlang Bot <dlang-bot@dlang.rocks> ---
@NilsLankila updated dlang/dmd pull request #11538 "add `__traits(getCurrentFunction)`" fixing this issue:

- fix issue 8109, 9306, add `__traits(getCurrentFunction)`

  This new traits is a shortcut allowing to call the function we
  are in without using `mixin` and `__FUNCTION__` tricks.

https://github.com/dlang/dmd/pull/11538

--
September 08, 2022
https://issues.dlang.org/show_bug.cgi?id=9306

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |razvan.nitu1305@gmail.com
         Resolution|---                         |WONTFIX

--