Should #line create a new namespace ?

Jonathan Marler via Digitalmars-d digitalmars-d at puremagic.com
Mon Sep 26 15:57:21 PDT 2016


On Sunday, 25 September 2016 at 07:30:49 UTC, Basile B. wrote:
> On Saturday, 24 September 2016 at 09:23:38 UTC, Dicebot wrote:
>> On 09/24/2016 10:14 AM, Basile B. wrote:
>>> When the file is specified, Shouldn't #line create a new 
>>> module ?
>>> [...]
>>> Currently this is not allowed, but what's the value added by 
>>> the filename then ?
>>
>> It was used to easier debug string mixins by changing their 
>> filename in reported errors. Now it is done by compiler by 
>> default and I don't know if any other use case remains.
>>
>> But is definitely is not intended to create a new module, D 
>> relies on strict 1-to-1 matching between files and modules.
>
> Then I suggest to deprecate it. It was not totally illegitimate 
> to think that it allows to create a new module.
>

+1 (It also doesn't jive with the __FILE_FULL_PATH__ intrinsic)


More information about the Digitalmars-d mailing list