[Issue 11330] Directory named as imported module should not stop module search

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Oct 28 06:33:19 PDT 2013


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



--- Comment #12 from Vladimir Panteleev <thecybershadow at gmail.com> 2013-10-28 15:33:14 EET ---
(In reply to comment #11)
> The change was made so that existing modules, like std.algorithm, could be
> split into multiple modules without breaking existing code.

This does not explain or justify the problem this bug report is describing.

> See http://wiki.dlang.org/DIP37

The DIP specification says NOTHING about treating the first directory in its
search path as the match for a package. As far as I can see, the behavior in
question is an artifact of a poor implementation. In fact, the DIP says the
following:

> Also, having a package and module with the same name 
> will result in an ambiguity error when you try and 
> import them (e.g. foo/bar/package.d and foo/bar.d).

So the current behavior actually deviates from the design!

> Directory names have always been regarded as having a 1:1 correspondence with
> package names in D. This is not new. std.algorithm corresponds to
> std/algorithm.d

This does not explain or justify the problem this bug report is describing.

> As I recall, this was debated at length and was implemented months ago.

I do not recall any discussion that reached a consensus that the first
directory in D's search path should be treated as the match for an import of
the same name.

> I am sorry it breaks some existing setups, but the behavior is designed, and is
> not a bug. There were several proposals, and this one broke the least and
> before this everyone has liked it.

I am sorry, but judging by your arguments quoted above, I must conclude that
you either don't understand the problem, or are unable to justify the current
behavior. I must ask you to read my arguments carefully and respond to my
clarification requests directly.

-- 
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