https://issues.dlang.org/show_bug.cgi?id=9306

[email protected] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #1 from [email protected] ---
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 ?

--

Reply via email to