__FUNCTION__

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


"grauzone" <none at example.net> wrote in message 
news:goc97a$15il$1 at digitalmars.com...
> 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
>
> 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.
>

*smacks self in forehead*, You know, I've even used that in my own code 
already, and still didn't think of it when I made that post.





More information about the Digitalmars-d mailing list