__FUNCTION__

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sat Feb 28 13:49:28 PST 2009


grauzone wrote:
> Andrei Alexandrescu wrote:
>> BCS wrote:
>>> Hello Andrei,
>>>
>>>> Nick Sabalausky wrote:
>>>>
>>>>> Stdout.formatln("{}", __FUNCTION__);
>>>>
>>>> I think instead of __FUNCTION__ we'll define a much more comprehensive
>>>> static reflection facility.
>>>>
>>>
>>> for the above case I think __FUNCTION__ is as good as it will get. 
>>> Define it as a human readable identifier rather than reflection.
>>>
>>>
>>
>> You will have it as a human readable identifier too. The problem with
>> __FUNCTION__, __CLASS__ etc. is that the list of ad-hoc names (what
>> happened to __STRUCT__, __MODULE__ et al?) can go forever.
> 
> For classes and structs, this is already possible: typeof(this).stringof

Not outside of a member function. This is crippling my Visitor 
implementation.

> Now we only need a way to get some kind of compile time object for 
> functions and modules (like the type for classes/structs). Then you 
> simply can use .stringof on them.

There's much more to reflection that we need to define.


Andrei



More information about the Digitalmars-d mailing list