Module name compile time constant?

davidl davidl at 126.com
Tue Apr 15 07:09:19 PDT 2008


在 Tue, 15 Apr 2008 15:12:13 +0800,Janice Caron <caron800 at googlemail.com>  
写道:

> On 15/04/2008, davidl <davidl at 126.com> wrote:
>>  I want some magic of module.name to get the current module name in  
>> compile
>> time string form.
>
> Yeah, basically you want to add __MODULE__ to the list of "special  
> tokens" in
> http://digitalmars.com/d/2.0/lex.html
>
> I think it would be easy for Walter to add, and I don't think it's
> particularly controversial, so why not just go ahead and add an
> enhancement request to Bugzilla.

I'm looking for a cleaner solution.
__SPEC_TOKEN__ for me looks like a hack.

and it's not so well defined if my app doesn't have a module declaration  
section?
should the compiler stop the compilation?


-- 
使用 Opera 革命性的电子邮件客户程序: http://www.opera.com/mail/



More information about the Digitalmars-d mailing list