Namespace for a module defined by its import path

ZombineDev via Digitalmars-d digitalmars-d at puremagic.com
Tue Nov 8 23:21:28 PST 2016


On Tuesday, 8 November 2016 at 18:33:13 UTC, Jeff Thompson wrote:
> On Tuesday, 8 November 2016 at 17:00:44 UTC, Jeff Thompson 
> wrote:
>> On Wednesday, 26 October 2016 at 17:12:30 UTC, Jonathan Marler 
>> wrote:
>>> On Wednesday, 26 October 2016 at 09:53:35 UTC, Jeff Thompson 
>>> wrote:
>>>> [...]
>>>
>>> I've thought about this and have concluded that you can't 
>>> replicate these semantics in D.  Here's 2 solutions though:
>>>
>>> [...]
>>
>> Right now, if a module doesn't have a package statement, the 
>> module name is the file name with the path and and extension 
>> stripped off. My problem would be solved by a compiler option 
>> to keep the path.
>
> ... or is there a way to get the path at compile time? I could 
> try some mixin magic to construct the package name including 
> the path.

I guess this is what you're looking for:
http://dlang.org/changelog/2.072.0.html#__FILE_FULL_PATH__


More information about the Digitalmars-d mailing list