www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - mixin(__MODULE__) fails if module name is "module"

reply "sigod" <sigod.mail gmail.com> writes:
E.g.:

module.d: (or just `module module;` in source file)
```
import std.stdio;

void main() {
     foreach (m; __traits(allMembers, mixin(__MODULE__))) { // 
module.d-mixin-4(4): Error: expression expected, not 'module'
         writeln(m);
     }
}
```

Documentation says:
 Package names cannot be keywords, hence the corresponding 
 directory names cannot be keywords, either.
Shouldn't keywords be disallowed for module names?
Jun 22 2014
next sibling parent reply "bearophile" <bearophileHUGS lycos.com> writes:
sigod:

 Shouldn't keywords be disallowed for module names?
I agree. (Walter seems not too keen on strictness). This question seems more fit for the main D newsgroup. Look in Bugzilla if there is a enhancement request. Bye, bearophile
Jun 22 2014
parent reply "sigod" <sigod.mail gmail.com> writes:
 This question seems more fit for the main D newsgroup.
Should I create new thread in the main newsgroup?
 Look in Bugzilla if there is a enhancement request.
Yeah. I found one: https://issues.dlang.org/show_bug.cgi?id=456
Jun 22 2014
parent "sigod" <sigod.mail gmail.com> writes:
I opened new issue: https://issues.dlang.org/show_bug.cgi?id=12986
Jun 24 2014
prev sibling parent "sigod" <sigod.mail gmail.com> writes:
On Sunday, 22 June 2014 at 12:52:11 UTC, sigod wrote:
 module.d: (or just `module module;` in source file)
I was wrong about `module module;` declaration.
Jun 22 2014