On Saturday, 26 October 2013 at 08:36:53 UTC, Walter Bright wrote:
On 10/26/2013 12:42 AM, eles wrote:
I'm curious why naming the file test.d is an issue?
This forces scrpts to bear the .d extension. For example, if you
write a script on Linux named "git-test" and you put at the top:
rdmd will pass its name to dmd, and dmd will try to compile...
"git-test.d", which does not exist.
Now, you have either to rename the "git-test" into "git-test.d",
or to create a hardlink named "git-test.d" that points towards
"git-test" so that dmd finally gets satisfied its ".d" hungriness.
The solution with the hardlink carries the well-known burdness of
redundancy, let's not even say its idiot and makes back-up-ing a
OTOH, renaming the original script into "git-test.d" has the
undesirable effect wrt to git software.
git uses some nice convention that you can extend its command
list by writing your own "git-command1", "git-command2" scripts
and they are invoked automatically by git when you type:
"git command1" (this will invoke "git-command1") etc.
The problem with being forced to rename "git-command1" into
"git-command1.d" is that, afterwards, you have to type the
following command for git:
"git command1.d" (in order to have the "git-command1.d" invoked,
as "git-command1" simply does not exist or, if it would exist,
dmd would be blind about it).
SO, you cannot type "git command1" and to have a "git-command1"
script invoked, because git won't search for "git-command1.d",
while dmd won't compile "git-command1".
So you need both "git-command1" and "git-command1.d" doing the
same thing, just to be able to type "git command1" (not even say
that this allows you to invoke, also "git comman1.d", which is
ugly and undesired redundancy).
Now, immagine yourself having to type:
"git checkout.d ."
"git checkout ."
and tell me that ".d" is not an issue.
Please have a look at the original thread that I linked and
you'll see the problem.
What use for scripting in D if I am unable to do some simple
scripts because of the compiler?