Name of files causes error. Why?

Xan xancorreu at gmail.com
Thu Apr 12 05:30:50 PDT 2012


On Wednesday, 11 April 2012 at 19:50:18 UTC, Steven Schveighoffer 
wrote:
> On Wed, 11 Apr 2012 15:33:56 -0400, Xan <xancorreu at gmail.com> 
> wrote:
>
>> Hi,
>>
>> With helloworld program named with score or underscore, I 
>> receive the following __annoying__ error:
>>
>> $ gdmd-4.6 hola-temp.d
>> hola-temp.d: Error: module hola-temp has non-identifier 
>> characters in filename, use module declaration instead
>>
>> Why?
>> Can someone fix it. It's really annoying
>>
>> Thanks in advance,
>> Xan.
>
> All d module files (i.e. d source files) must be a valid 
> identifier.
>
> See this document for what an identifier can contain: 
> http://dlang.org/lex.html#Identifier
>
> Now, you *can* possibly name the module differently using a 
> module statement, but this is highly discouraged.  If you do 
> this, the only way another module can import your 
> differently-named module is if you pass the file on the command 
> line.
>
> -Steve

But it's a messy limitation. Why we should have it? For C++ 
compatibilities?


Thanks,


More information about the Digitalmars-d-learn mailing list