Anonymous user
Program name: Difference between revisions
→{{header|D}}
(Added Pascal) |
|||
Line 280:
=={{header|D}}==
Will print name of executable.
<lang d>
import std.stdio;
void main(string[] args) {
string program =
writeln("Program: ", program);
}</lang>
The D programming language offers an interpreted mode, which exhibits slightly a different behavior than the compiler.
<lang sh>$ ./scriptname.d
Program: /tmp/.rdmd/Users/andrew/Desktop/src/scriptname/scriptname.d.D3B32385A31B968A3CF8CAF1E1426E5F
$ dmd scriptname.d
$ ./scriptname
Program: ./scriptname</lang>
=={{header|Emacs Lisp}}==
|