[Issue 11365] Allow D source file names to have no extension (or an arbitrary extension)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Oct 31 10:08:59 PDT 2013


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


Mathias LANG <pro.mathias.lang at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pro.mathias.lang at gmail.com


--- Comment #12 from Mathias LANG <pro.mathias.lang at gmail.com> 2013-10-31 10:08:55 PDT ---
Why should we enforce this ? We enforce things to prevent obvious mistakes. D
language plays well in this field. It ensures what it is sure needs to be
ensured, and give you the tools to build your own rules, with the least
burdens.

It's not a mistake to have a source file with an arbitrary extension, or no
extension at all. DMD will still now it's argument is a source file, whatever
its name is. And they're some valid use cases where you would not want a .d[i]
extension, as eles noticed in the quoted comment above, and in the NG.

(In reply to comment #9)
> Having a standard extension for D code is useful for programs like "cloc" that
> count lines of code, with editors that open .d files with correct D
> colorization, for my scripts that select files with .d suffix to test
> incompatibilities across different compiler versions. I have testing scripts
> that test .d files differently from .py files looking in directories. And it's
> not just a matter of my own code, it also mattes from D libraries from other
> people.

As you point, there are also some use cases where some tool require a specific
extension. But that's none of our business, the tool should ensure it, not DMD.
The real problem for those tools is to know what the file holds. We don't have
such problems with DMD.
For the record, good editors solve the problem easily, like vim or emacs:
# vim: syntax=d ts=4 sw=4 sts=4 sr noet
# -*- d-mode -*-

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