On Tue, Sep 4, 2012 at 2:00 PM, Jonathan M Davis <jmdavisProg@gmx.com> wrote:
On Tuesday, September 04, 2012 22:40:19 Andrej Mitrovic wrote:
> On 9/4/12, Jonathan M Davis <jmdavisProg@gmx.com> wrote:
> > But it looks like we now have std.traits.moduleName, so presumably that
> > will do the trick.
>
> How will that do the trick if you don't have the reference to the
> invoking module?

Clearly, I didn't read the OP clearly enough.

Unless you can get code to be generated in the calling scope (e.g. with
mixins), then the _only_ access that you have to anything in the calling scope
is with __FILE__ and __LINE__. And they only work that way because they're
treated as special cases (they _don't_ work that way in C/C++).

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.