__FUNCTION__

Nick Sabalausky a at a.a
Sat Feb 28 11:15:11 PST 2009


"dsimcha" <dsimcha at yahoo.com> wrote in message 
news:goc1k7$qml$1 at digitalmars.com...
> == Quote from Jarrett Billingsley (jarrett.billingsley at gmail.com)'s 
> article
>> Can we get this please?  It's so simple and would be terribly useful.
>
> Can someone explain what __FUNCTION__ would do in a little more detail?  I 
> feel
> like the two posts of this thread so far are talking in secret 
> __FUNCTION__-dealer
> code.

void foofunc()
{
    Stdout.formatln("{}", __FUNCTION__);
}

Output:
foofunc

Ie, basically the same as __FILE__ and __LINE__ and useful in the same ways.

Also, I'd like to be able to do something like:

Reflect.invoke(__FUNCTION__, params);

Something funtionally equiveilent to that would aid maitenance of 
self-invoking functions (not only recusion, but also func overloads that are 
defined in terms of one "primary" overload).

Also would be nice for similar reasons: __CLASS__ (or something similar that 
would also work for structs) 





More information about the Digitalmars-d mailing list