On 2012-02-05 14:16, Simen Kjærås wrote:
On Sun, 05 Feb 2012 11:58:40 +0100, Vidar Wahlberg <[email protected]>
wrote:
Also, is this really ambiguous? Are there any cases where you can have
a module name followed by a parentheses, i.e. "<module>("?

Not that I know.

Possibly something that could make the language slightly more newbie friendly here, then. For now I'll just keep the filenames in lowercase so i "import struct;" rather than "import Struct;" (I see the norm for D is to keep the filenames in lowercase, might as well follow it).

Adding a note about GDC (4.6.2) here:
It appears like it ignores "module <name>;" and always use the filename for module name (or I've misunderstood what "module" is used for). If I create a file "Foo.d" which contains "module foo;", then in any other file I wish to include module "foo" in I must write "include Foo;", not "include foo;".


I'm using gdc-4.6 (Debian 4.6.2-4).

Ah. That's the equivalent of DMD 2.054. I don't have that installed, but
it may be that this feature was not added until after that.

Fix: install GDC 4.6.1: https://bitbucket.org/goshawk/gdc/downloads

I'm running GDC 4.6.2, not 4.6.0 (I just pasted output from "gdc-4.6 --version", I could've made it clearer), downgrading probably won't help me.


Workaround: Use a templated opEquals:

struct Struct {
int baz;
bool opEquals()(const Struct s) const {
return baz == s.baz;
}
}

Hope this works.

Yes, it does. I have to read a bit about templating as I don't understand exactly what that "()" means, but it did solve my problem, thanks!

Reply via email to