Wednesday, October 26, 2005

Module naming scheme

I have been trying to create an interpreter for DP6 in D, and one of the annoying things I have found, is that you can't have a module with the name io, and one with the name io.file. There is a good reason for it, since if you have a class with the name file, in the module io that would cause name collisions.

So what I'm planning fo DP6 is that the module heirarchy will use double colons like Perl. Then io and io::file couldn't possibly have name collisions, because the class file in the module io will be addressed by io.file.

I also like the way you can switch modules in Perl. So I am conidering allowing a module switch packages. It really depends on whether that could cause a bunch of headache when writing a compiler.