[Issue 9664] Make directory in import path like "a.b.c" a properly supported feature

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Mar 8 10:31:12 PST 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9664



--- Comment #4 from bearophile_hugs at eml.cc 2013-03-08 10:31:08 PST ---
(In reply to comment #3)
> Modules correlate to files and packages correlate to folders, and the
> relationship is 1-to-1. That's the design. It's straightforward and simple.
> This very much goes against that.

I agree.

Generally I am for keeping the language tidy. Because most times you don't do
this, later something comes back to bite your butt.

----------------------

The following things are mostly off topic for this Bugzilla entry:

> And it would be even better IMHO if it weren't legal to have modules which
> didn't have a module declaration (since you pretty much always have to have it
> anyway, as it's required if the module is in a package),

If your program is composed by only 1 module (like when you write very short
programs), then in my opinion it's not necessary to give it a module
declaration.

The module declaration is "infrastructure". Infrastructure is very useful when
programs grow bigger, but being forced to put infrastructure when you don't
need it, that is in very small programs, is a waste of energy.


> and I think that allowing for modules to have different names than their
> file names was a mistake, as it adds extra complication and confusion

I agree.


> for no benefit IMHO.

Walter has said there is some benefit (but I don't remember what). Even if this
is true, then I think such cases are special. And it's generally bad to break a
tidy convention for some special cases. If those cases are so important then
they should have a special "syntax", leaving the much more general case clean
of 1:1 between module name and file name.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list