A simple question

Stugol stugol at gmx.com
Thu Nov 15 18:55:53 PST 2012


On Friday, 16 November 2012 at 02:22:32 UTC, Adam D. Ruppe wrote:
> On Friday, 16 November 2012 at 02:00:05 UTC, Stugol wrote:
>> Hmm, that makes a bit more sense now I guess. Funny, I don't 
>> remember seeing that rule when I read the documentation.
>
> It might not be clear, but it is there:
>
> http://dlang.org/module.html
> "The ModuleDeclaration sets the name of the module and what 
> package it belongs to. If absent, the module name is taken to 
> be the same name (stripped of path and extension) of the source 
> file name."
>
> The parenthesis is important in this case - once the name is 
> stripped of path, it only leaves a simple name, no more package 
> info.

I'm not quite sure what purpose the MODULE keyword serves in any 
case. I have a file "Include.D\Infinity\Standard\Mixins\Event.d", 
but if I give it a module name of "infinity.standard.event" it 
doesn't work. I have to include the ".mixins" part. So what's the 
point?

Also, I'm having difficulty specifying a default specialisation 
for a template class:

    class Event(TEventArgs : EventArgs = EventArgs) {
    }

Usage:

    Event!() e1;     // Works
    Event e2;        // Won't compile

How can I have "Event" be an alias for "Event!EventArgs"?


More information about the Digitalmars-d mailing list