January 12, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=5140



--- Comment #20 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-01-12 10:28:13 PST ---
(In reply to comment #8)
> > entirely different things. __FUNCTION__ is a string, whereas __function is an alias to the function that it's used in.
> 
> I agree they are two quite different things, so probably I have to move the request for __function in another enhancement request.

Please make another enhancement request for this, so it's not forgotten and we can wait for a separate approval.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 12, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=5140



--- Comment #21 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-01-12 10:42:15 PST ---
(In reply to comment #8)
> But they are also related, as you can implement anonymous recursion with __FUNCTION__:
> 
> 
> long fact(long n) {
>     if (n <= 1)
>         return 1;
>     else
>         mixin("return n * " ~ __FUNCTION__ ~ "(n - 1);");
> }

This is unreliable. If `fact` is nested inside of a mixin template you won't be able to call the function this way. On another note this has uncovered a new ICE in Issue 9182.

It's also very untidy to have to use mixins and string representation for recursive calls. It's much simpler to use 'return __function(n - 1)'.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 12, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=5140



--- Comment #22 from bearophile_hugs@eml.cc 2013-01-12 13:47:44 PST ---
(In reply to comment #20)

> Please make another enhancement request for this, so it's not forgotten and we can wait for a separate approval.

OK. See Issue 9306

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 07, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=5140



--- Comment #23 from github-bugzilla@puremagic.com 2013-03-06 20:02:48 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/1822acb7a47ae71c3889db2c26efbfb7d1c64c5c
Fixes Issue 5140 - Implement __FUNCTION__, __PRETTY_FUNCTION__, and
__MODULE__ feature.

https://github.com/D-Programming-Language/dmd/commit/fd628d8170730cf01f318e1b15e0d894be358f17 Merge pull request #1462 from AndrejMitrovic/Fix5140

[enh] Issue 5140 - Implement __FUNCTION__, __PRETTY_FUNCTION__ and __MODULE__

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 07, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=5140


Andrej Mitrovic <andrej.mitrovich@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
1 2 3
Next ›   Last »