DIP61: Add namespaces to D

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Sat Apr 26 16:29:47 PDT 2014


On 04/27/2014 01:11 AM, Dicebot wrote:
> On Saturday, 26 April 2014 at 23:05:23 UTC, Timon Gehr wrote:
>> On 04/27/2014 12:43 AM, Dicebot wrote:
>>> On Saturday, 26 April 2014 at 21:57:55 UTC, Timon Gehr wrote:
>>>> On 04/26/2014 09:27 PM, Daniel Murphy wrote:
>>>>>
>>>>> We already have a feature to manage conflicts and organisation in D
>>>>> code - modules!
>>>>
>>>> Named mixin templates are a much closer fit.
>>>
>>> Using named mixin templates for pure scope resolution is side effect and
>>> should be discouraged in any reasonable code.
>>
>> I don't really advocate using named mixin templates directly as much
>> as just the same lookup rules.
>
> Well that wasn't clear from your comments at all, quite the contrary ;)
> ...

Wtf?

>>> There are specific D tools
>>> designed for that  from the very beginning
>>
>> Named mixin templates are also 'designed for scope resolution from the
>> very beginning' if that means anything.
>>
>>> and we should use and/or fix those.
>>
>> They don't fit. You simply cannot have multiple D modules per file.
>
> I don't see any problem with having lot of files. It is natural way
> organizing D code  if you consider protection attributes that define
> module as minimal encapsulation unit.

I don't see the point of requiring replication of the namespace 
structure in directories just for the sake of conflating modules and 
namespaces, even though #includes bear a closer resemblance in usage to 
imports than using directives and doing better is basically free because 
the required lookup semantics are already there. Why discuss anything 
but syntax at this point?


More information about the Digitalmars-d mailing list