Re: Function name from function pointer

2015-04-11 Thread Paul D Anderson via Digitalmars-d-learn
On Saturday, 11 April 2015 at 19:08:50 UTC, Marco Leise wrote: Am Sat, 11 Apr 2015 18:28:35 + schrieb "Paul D Anderson" : Is there a way to return the name of a function (a string) from a pointer to that function? Function pointer example from D Reference: --- int function() fp; void tes

Re: Function name from function pointer

2015-04-11 Thread bearophile via Digitalmars-d-learn
Paul D Anderson: Is there a way to return the name of a function (a string) from a pointer to that function? Perhaps creating a string[void*] AA and initializing with all the function pointers you care about. Bye, bearophile

Re: Function name from function pointer

2015-04-11 Thread Marco Leise via Digitalmars-d-learn
Am Sat, 11 Apr 2015 18:28:35 + schrieb "Paul D Anderson" : > Is there a way to return the name of a function (a string) from a > pointer to that function? > > Function pointer example from D Reference: > --- > int function() fp; > > void test() > { > static int a = 7; > static int

Function name from function pointer

2015-04-11 Thread Paul D Anderson via Digitalmars-d-learn
Is there a way to return the name of a function (a string) from a pointer to that function? Function pointer example from D Reference: --- int function() fp; void test() { static int a = 7; static int foo() { return a + 3; } fp = &foo; } void bar() { test(); int i = fp();