Getting the name of current module

Philippe Sigaud philippe.sigaud at gmail.com
Thu Aug 26 15:13:36 PDT 2010


On Thu, Aug 26, 2010 at 22:37, bearophile <bearophileHUGS at lycos.com> wrote:

> Philippe Sigaud:
> > does anyone of you know a way to get the name of the current module at
> > compile-time?
>
> It's one of the missing pieces of the static reflection:
> __traits(thisModuleName)
>
> I want this to return an expression tuple with all the package / module
hierarchy:  "std", "stdio". That way, I can easily find the package name
too... *daydreaming*

Maybe a generic __traits(thisScopeName) could be interesting: at the root of
a module, it gives the module name, in a function, the function name, class
name, etc.


Philippe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20100827/bf14195c/attachment.html>


More information about the Digitalmars-d mailing list