Is there any good reason why C++ namespaces are "closed" in D?

Manu turkeyman at gmail.com
Thu Aug 2 06:08:44 UTC 2018


On Wed, 1 Aug 2018 at 22:15, Walter Bright via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
>
> On 8/1/2018 12:01 PM, Manu wrote:
> > You've never justified the design
> > complexity and the baggage it carries.
> Don't confuse you not agreeing with it with I never justified it.
>
> And please don't confuse me not listening to you with me not agreeing with you.
>
> It *is* possible for reasonable people to disagree, especially when any solution
> will involve many tradeoffs and compromises.

We have demonstrated consistent ongoing issues and frustration for 6
years. Your counter-argument is hypothetical at best, and has never
demonstrated an advantage.
Can you agree on that? I don't think that's a subjective quantity
where reasonable people may disagree.

If the namespace is useful in a minor subset of cases in the way you
argue, then it should be a secondary feature which can be deployed
independently as appropriate.
It should not be conflated into a basic mangling request which we
can't opt-out of. We are yet to observe a case where it was useful,
and we have to do ongoing work to try and un-do the effect on our
code.

I also want to stress, I'm not trying to change the existing code. I'm
not for a breaking change.
I think implementing the string alternative is the only robust way
forward, because that also solves the additional problem of being able
to name C++ namespaces that are invalid D keywords, which has bitten
me in at least 2 particularly noteworthy occasions.
Your hypothetical scenario may continue to be served if you like.


More information about the Digitalmars-d mailing list