www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Source File and Directory same name

reply DemmeGod <me demmegod.com> writes:
DMD does not allow a .d file and a directory by the same name to coexist in
the same directory.  If this is on purpose, it's not noted in the specs. 
In my opinion, it should be allowed, not that anyone asked for my opinion.

DemmeGod

Example
---------------
[com/demmegod/lwLog4D.d]
module com.demmegod.lwLog4D;

import com.demmegod.lwLog4D.Logger;

[com/demmegod/lwLog4D/Logger.d]
module com.demmegod.lwLog4D.Logger;

import com.demmegod.lwLog4D;

class Logger
{
        Appender[] appenders = [];      
        static Logger globalLogger;
        
        static Logger getGlobalLogger()
        {
                ...
        }
        
        static void setGlobalLogger(Logger _globalLogger)
        {
                ...
        }
        
        this()
        {
                ...
        }
        
        void log(LogPriority priority, char[] message)
        {
                ...
        }
        
        void addAppender(Appender appender)
        {
                ...
        }
        
        void removeAppender(Appender appender)
        {
                ...
        }
}

...Plus more classes...

When I try to compile lwLog4D.d, I get the following error:
com/demmegod/lwLog4D.d(1): module lwLog4D module and package have the same
name
May 11 2004
next sibling parent J Anderson <REMOVEanderson badmama.com.au> writes:
DemmeGod wrote:

DMD does not allow a .d file and a directory by the same name to coexist in
the same directory.  If this is on purpose, it's not noted in the specs. 
  
In my opinion, it should be allowed, not that anyone asked for my opinion.
  
I agree. -- -Anderson: http://badmama.com.au/~anderson/
May 11 2004
prev sibling parent "Walter" <newshound digitalmars.com> writes:
Having the same name for both a package and a module just isn't going to
work - sorry.
May 25 2004