<br><br><div class="gmail_quote">On Thu, Aug 26, 2010 at 22:37, bearophile <span dir="ltr"><<a href="mailto:bearophileHUGS@lycos.com">bearophileHUGS@lycos.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;">
Philippe Sigaud:<br>
<div class="im">> does anyone of you know a way to get the name of the current module at<br>
> compile-time?<br>
<br>
</div>It's one of the missing pieces of the static reflection:<br>
__traits(thisModuleName)<br><br></blockquote><div>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*<br>
<br>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.<br><br><br>Philippe<br> <br></div></div>