digitalmars.D.bugs - [Issue 7730] New: Make imports work case-sensitive on all platforms
- d-bugmail puremagic.com (21/21) Mar 18 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7730
- d-bugmail puremagic.com (9/9) Mar 18 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7730
- d-bugmail puremagic.com (11/11) Mar 18 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7730
- d-bugmail puremagic.com (8/10) Mar 18 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7730
- d-bugmail puremagic.com (11/13) Mar 19 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7730
- d-bugmail puremagic.com (10/15) Mar 19 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7730
- d-bugmail puremagic.com (30/30) Mar 19 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7730
- d-bugmail puremagic.com (20/47) Mar 19 2012 I'm not really that much into the internals of dmd, but in the given cas...
- d-bugmail puremagic.com (9/9) Mar 19 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7730
- d-bugmail puremagic.com (9/14) Mar 19 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7730
- d-bugmail puremagic.com (10/15) Mar 20 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7730
- d-bugmail puremagic.com (15/42) Mar 21 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7730
http://d.puremagic.com/issues/show_bug.cgi?id=7730 Summary: Make imports work case-sensitive on all platforms Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: armin.kazmi tu-dortmund.de --- Comment #0 from Armin Kazmi <armin.kazmi tu-dortmund.de> 2012-03-18 14:20:36 PDT --- One of the major issues (or lets say, enerving ones) one has when porting from e.g. Windows to other platforms is constant mixture of filename/dirname casing of imports/includes in the sourcecode, which doesn't match the filename case. I think DMD should enforce that the source path case is consistent with the module name in order to eliminate such issues. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 18 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7730 Walter Bright <bugzilla digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bugzilla digitalmars.com Severity|normal |enhancement -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 18 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7730 bearophile_hugs eml.cc changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bearophile_hugs eml.cc --- Comment #1 from bearophile_hugs eml.cc 2012-03-18 19:32:42 PDT --- This is an interesting idea, but I think there are also other alternatives. Like requiring & enforcing all module names to be fully lower-case. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 18 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7730 --- Comment #2 from Armin Kazmi <armin.kazmi tu-dortmund.de> 2012-03-18 19:37:40 PDT --- (In reply to comment #1)This is an interesting idea, but I think there are also other alternatives. Like requiring & enforcing all module names to be fully lower-case.That's also a variant. I actually don't care which one is taken, but I think some enforced standard is really needed here. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 18 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7730 Jacob Carlborg <doob me.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |doob me.com --- Comment #3 from Jacob Carlborg <doob me.com> 2012-03-19 00:14:24 PDT --- (In reply to comment #1)This is an interesting idea, but I think there are also other alternatives. Like requiring & enforcing all module names to be fully lower-case.That would completely break Tango. I don't like the idea. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 19 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7730 --- Comment #4 from Armin Kazmi <armin.kazmi tu-dortmund.de> 2012-03-19 03:41:27 PDT --- (In reply to comment #3)(In reply to comment #1)I wouldn't really exaggerate that. Actually using a find/sed expression thats quite easy to fix. What I simply want is to have it consistent import/module-lookup behavior across all platforms to save all that mess one already has in C/C++ with it. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------This is an interesting idea, but I think there are also other alternatives. Like requiring & enforcing all module names to be fully lower-case.That would completely break Tango. I don't like the idea.
Mar 19 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7730 Stewart Gordon <smjg iname.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |smjg iname.com --- Comment #5 from Stewart Gordon <smjg iname.com> 2012-03-19 05:13:27 PDT --- The problem at the moment is that the capitalisation of a module's name, in the absence of a module declaration, depends on the name by which it is referenced. Try this at home: ----- modulecap_a.d ----- import modulecap_b; ----- ModuleCap_b.d ----- int x = .y; ---------- C:\Users\Stewart\Documents\Programming\D\Tests>dmd modulecap_b.d modulecap_b.d(1): Error: undefined identifier module modulecap_b.y C:\Users\Stewart\Documents\Programming\D\Tests>dmd ModuleCap_b.d ModuleCap_b.d(1): Error: undefined identifier module ModuleCap_b.y C:\Users\Stewart\Documents\Programming\D\Tests>dmd modulecap_a.d modulecap_b.d(1): Error: undefined identifier module modulecap_b.y ---------- I can imagine this leading to havoc if the same module is referenced from different modules by different capitalisations of the name. If there's a module declaration, go with that. Otherwise, go with the actual capitalisation of the filename, thereby ensuring platform-consistent behaviour. That said, are there any 32+-bit platforms on which filenames aren't case-retentive? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 19 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7730 --- Comment #6 from Armin Kazmi <armin.kazmi tu-dortmund.de> 2012-03-19 05:28:29 PDT ---The problem at the moment is that the capitalisation of a module's name, in the absence of a module declaration, depends on the name by which it is referenced. Try this at home: ----- modulecap_a.d ----- import modulecap_b; ----- ModuleCap_b.d ----- int x = .y; ---------- C:\Users\Stewart\Documents\Programming\D\Tests>dmd modulecap_b.d modulecap_b.d(1): Error: undefined identifier module modulecap_b.y C:\Users\Stewart\Documents\Programming\D\Tests>dmd ModuleCap_b.d ModuleCap_b.d(1): Error: undefined identifier module ModuleCap_b.y C:\Users\Stewart\Documents\Programming\D\Tests>dmd modulecap_a.d modulecap_b.d(1): Error: undefined identifier module modulecap_b.y ----------I'm not really that much into the internals of dmd, but in the given case, dmd could fail to import "ModuleCap_b" by simply comparing it with the import case "modulecap_b" and also output a warning that one should check the case. Also, for the same reason, all arguments passed into dmd which refer to files, should also work case-sensitive (just to make it easier to have makefiles, buildscripts work correctly across platforms).I can imagine this leading to havoc if the same module is referenced from different modules by different capitalisations of the name. If there's a module declaration, go with that. Otherwise, go with the actual capitalisation of the filename, thereby ensuring platform-consistent behaviour.I know how to "prevent" that issue. You're pretty much forced to prevent it when using linux. But seeing a lot of C/C++ code in windows, windows developers simply ignore the problem altogether. Also, I think, that such trivial code should really work exactly in the same way to the file level across all platforms. It's not hard to implement it and would completely eliminate such issues before they start becoming popular. I really wondered why that wasn't a design decision from day one. (BTW: similar arguments are valid for int vs size_t)That said, are there any 32+-bit platforms on which filenames aren't case-retentive?I don't know -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 19 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7730 --- Comment #7 from Armin Kazmi <armin.kazmi tu-dortmund.de> 2012-03-19 05:31:12 PDT --- Another reason to change that as early as possible, is, a breaking change now is partially acceptable, but becomes more and more a problem if the language gets popular and multi-million-loc projects pop up. One could stop that issue from happening ever again now. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 19 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7730 --- Comment #8 from Jacob Carlborg <doob me.com> 2012-03-19 08:30:57 PDT --- (In reply to comment #4)I wouldn't really exaggerate that. Actually using a find/sed expression thats quite easy to fix.That might be the case but it would still break a lot of code.What I simply want is to have it consistent import/module-lookup behavior across all platforms to save all that mess one already has in C/C++ with it.I would mind having that either, but I don't want the compiler to force all lowercase. Instead it should force case-sensitive if possible. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 19 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7730 --- Comment #9 from Stewart Gordon <smjg iname.com> 2012-03-20 15:29:55 PDT --- (In reply to comment #8)(In reply to comment #4)Is there any way we could reasonably deprecate using uppercase letters in module names? (If only we could declare aliases of modules, we could make the old name a deprecated alias for the new one....) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------I wouldn't really exaggerate that. Actually using a find/sed expression thats quite easy to fix.That might be the case but it would still break a lot of code.
Mar 20 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7730 Don <clugdbug yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |clugdbug yahoo.com.au --- Comment #10 from Don <clugdbug yahoo.com.au> 2012-03-21 02:21:57 PDT --- (In reply to comment #5)The problem at the moment is that the capitalisation of a module's name, in the absence of a module declaration, depends on the name by which it is referenced. Try this at home: ----- modulecap_a.d ----- import modulecap_b; ----- ModuleCap_b.d ----- int x = .y; ---------- C:\Users\Stewart\Documents\Programming\D\Tests>dmd modulecap_b.d modulecap_b.d(1): Error: undefined identifier module modulecap_b.y C:\Users\Stewart\Documents\Programming\D\Tests>dmd ModuleCap_b.d ModuleCap_b.d(1): Error: undefined identifier module ModuleCap_b.y C:\Users\Stewart\Documents\Programming\D\Tests>dmd modulecap_a.d modulecap_b.d(1): Error: undefined identifier module modulecap_b.y ---------- I can imagine this leading to havoc if the same module is referenced from different modules by different capitalisations of the name. If there's a module declaration, go with that. Otherwise, go with the actual capitalisation of the filename, thereby ensuring platform-consistent behaviour. That said, are there any 32+-bit platforms on which filenames aren't case-retentive?Not according to this: http://en.wikipedia.org/wiki/Filename Moreover, it seems that anything which doesn't retain case, doesn't allow very long filenames. I can't see any reason to require lowercase. It is simple to require that filename case matches module case. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 21 2012