Collect multiple modules under a single name:
If you use a source file with a filename that isn't a valid identifier in D (such as "foo-bar.d"), you need to add a module statement with a valid identifier to get it to compile:
module foobar;from NG:digitalmars.D/29764
D reserves the module name of "object" (e.g. "object.d") for the built-in object base class which is automatically imported. ( NG:digitalmars.D.announce/4313), but there might be a work-around if it has to be called "object" ( NG:digitalmars.D.announce/4318).
Keywords can't be part of a module name at all since module and package names are identifiers. For example, given "import std.stdio;", the "std" and "stdio" are both identifiers.
Put your comments about the official/non-official page here.
This looks like a typing error to me:
import foo; ... q = y; // sets q to foo.yShouldn't y be foo.y? -- PeterEriksen?
- If only one "y" identifier has been declared (or imported), the compiler shouldn't have a problem finding it. When only foo is imported, D figures out that the desired "y" is from the "foo" module. Looks fine to me. -- JustinCalvarese