Thread overview
Source File and Directory same name
May 12, 2004
DemmeGod
May 12, 2004
J Anderson
May 25, 2004
Walter
May 12, 2004
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 12, 2004
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 25, 2004
Having the same name for both a package and a module just isn't going to work - sorry.