How is the D programming language financed?

Caligo iteronvexor at gmail.com
Thu Dec 23 21:31:30 PST 2010


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 <andrej.mitrovich at gmail.com
> wrote:

> On 12/24/10, Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org> 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);
> }
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20101223/2496a78f/attachment.html>


More information about the Digitalmars-d mailing list