I don't get it. How is it able to get the name of the module like that?<br><br><div class="gmail_quote">On Thu, Dec 23, 2010 at 9:35 PM, Andrej Mitrovic <span dir="ltr"><<a href="mailto:andrej.mitrovich@gmail.com">andrej.mitrovich@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">On 12/24/10, Andrei Alexandrescu <<a href="mailto:SeeWebsiteForEmail@erdani.org">SeeWebsiteForEmail@erdani.org</a>> wrote:<br>
> Don't forget to call your program stats.d or put a module stats<br>
> declaration at its top.<br>
><br>
> Andrei<br>
><br>
<br>
</div>Hardcoding module names in our code?! I beg to differ, sir!<br>
<br>
module testmodule;<br>
<br>
import std.string : split;<br>
import std.stdio : writeln;<br>
<br>
string modulename = split(.stringof)[1];<br>
<br>
void main()<br>
{<br>
writeln(modulename);<br>
}<br>
</blockquote></div><br>