I don't get it.  How is it able to get the name of the module like that?

On Thu, Dec 23, 2010 at 9:35 PM, Andrej Mitrovic <[email protected]
> wrote:

> On 12/24/10, Andrei Alexandrescu <[email protected]> wrote:
> > Don't forget to call your program stats.d or put a module stats
> > declaration at its top.
> >
> > Andrei
> >
>
> Hardcoding module names in our code?! I beg to differ, sir!
>
> module testmodule;
>
> import std.string : split;
> import std.stdio : writeln;
>
> string modulename = split(.stringof)[1];
>
> void main()
> {
>    writeln(modulename);
> }
>

Reply via email to