Compiler error with static vars/functions

Artur Skawina art.08.09 at gmail.com
Fri Feb 10 07:38:12 PST 2012


On 02/10/12 16:18, Don Clugston wrote:
> On 10/02/12 16:08, Artur Skawina wrote:
>> On 02/10/12 15:18, Don Clugston wrote:
>>> On 09/02/12 23:03, Jonathan M Davis wrote:
>>>> On Thursday, February 09, 2012 14:45:43 bearophile wrote:
>>>>> Jonathan M Davis:
>>>>>> Normally, it's considered good practice to give modules names which are
>>>>>> all lowercase (particularly since some OSes aren't case-sensitive for
>>>>>> file operations).
>>>
>>> That's just a Walter thing, and it's bollocks. There's no need to use all lower case.
>>
>> No, having non-lower case filenames would just lead to problems. Like different
>> modules being imported depending on the filesystem being used, or the user's
>> locale settings.
> 
> I don't think it's possible without deliberate sabotage. You can't have two files with names differing only in case on Windows. And module declarations acts as a check anyway.

What if you have two modules in the import path, eg a "thread" provided by
some library and another "Thread" elsewhere? Now "import Thread;" will do 
different things depending on the filesystem on which "Thread.d" resides.
It simply can't work, it would be great if no filesystem tried to muck with
the case, but unfortunately they do. 
The compiler should probably enforce module names to be plain ascii and
lower case every filename before trying to access it. Having mixed-case
*module* names makes sense, just not the filenames.

artur


More information about the Digitalmars-d-learn mailing list