On Tue, Sep 4, 2012 at 2:00 PM, Jonathan M Davis <span dir="ltr"><<a href="mailto:jmdavisProg@gmx.com" target="_blank">jmdavisProg@gmx.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Tuesday, September 04, 2012 22:40:19 Andrej Mitrovic wrote:<br>
> On 9/4/12, Jonathan M Davis <<a href="mailto:jmdavisProg@gmx.com">jmdavisProg@gmx.com</a>> wrote:<br>
> > But it looks like we now have std.traits.moduleName, so presumably that<br>
> > will do the trick.<br>
><br>
> How will that do the trick if you don't have the reference to the<br>
> invoking module?<br>
<br>
</div></div>Clearly, I didn't read the OP clearly enough.<br>
<br>
Unless you can get code to be generated in the calling scope (e.g. with<br>
mixins), then the _only_ access that you have to anything in the calling scope<br>
is with __FILE__ and __LINE__. And they only work that way because they're<br>
treated as special cases (they _don't_ work that way in C/C++).</blockquote><div><br></div><div>C/C++ may not need __FILE__ and __LINE__ to get evaluated at the call site because C/C++ have preprocessor macros to get around this problem.</div>
</div>