Bug 19665 – Package modules are meaningless

Status
RESOLVED
Resolution
INVALID
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-02-11T00:25:13Z
Last change time
2019-02-11T03:43:58Z
Assigned to
No Owner
Creator
Victor Porton

Comments

Comment #0 by porton — 2019-02-11T00:25:13Z
It seems for me a meaningless feature, package modules. Instead of libweb/package.d we could equally well use just libweb.d (without then disallowing as now libweb/ subpackages). Maybe we should reconsider and deprecate package modules, in regard to simply modules having the package name as the name?
Comment #1 by greeenify — 2019-02-11T01:39:54Z
I'm not sure I understand the advantage of deprecating a lot of code about a naming issue. What's the advantage of foo.d foo/a.d Over foo/package.d foo/a.d ?
Comment #2 by porton — 2019-02-11T01:42:14Z
Deprecating, not invalidating. > What's the advantage of > > > foo.d > foo/a.d > > Over > > foo/package.d > foo/a.d The advantage is cleaner idea that it is package foo (and also decreasing the number of path components).
Comment #3 by dlang-bugzilla — 2019-02-11T03:36:23Z
Not a bug in any D code. Language changes are done via DIPs. You may want to review the discussions for the feature back when it was introduced for clarification on why this feature was designed the way it is.
Comment #4 by destructionator — 2019-02-11T03:39:09Z
It does bug me that it is inconsistent with other modules though: in no other case does the filename matter (aside from automatic lookups). You are allowed to have blargh.d with module whatever.you.want;. So why must this one special case require the package.d filename? but meh, it isn't a bug as it is working as designed.
Comment #5 by dlang-bugzilla — 2019-02-11T03:43:58Z
(In reply to Adam D. Ruppe from comment #4) > It does bug me that it is inconsistent with other modules though: in no > other case does the filename matter (aside from automatic lookups). You are > allowed to have blargh.d with module whatever.you.want;. So why must this > one special case require the package.d filename? Personally, I always considered that mismatching module and file names was just the implementation being overly permissive. It only works with certain build systems and breaks a number of other assumptions for various tooling, so I'm happy to write that off in the "it works but don't do that" category.