I'm pretty new to looking at D (like...yesterday, after looking for Kotlin benchmarks...) and currently trying to decide if it's a language I want to cope with.
I'm trying to pass some arguments from command line and I'm a little surprised. Let's say I pass "-Foo -Bar". My program is quite simple:
import std.stdio;
void main(string [] args) {
foreach(arg; args) {
writeln(arg);
}
}
Coming from Java, I expected it to print
- -Foo
- -Bar
But my D program seems to receive its location as the first argument? The output is:
- /home/(username)/Java_Projects/HelloD/hellod
- -Foo
- -Bar
I tried searching for this, but all Google hits refer to Java's -D switch... So, is this intended behaviour? If yes, does anyone know why?