<div dir="auto"><div><div class="gmail_quote"><div dir="ltr">On Sun., 29 Jul. 2018, 12:40 am Walter Bright via Digitalmars-d, <<a href="mailto:digitalmars-d@puremagic.com">digitalmars-d@puremagic.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 7/28/2018 11:06 PM, Nicholas Wilson wrote:<br>
> Then again I don't see any (non philosophical/compiler front end internal) issue <br>
> why you can't reopen a namespace. D is supposed to be pragmatic, after all.<br>
<br>
Consider if a template reopens a namespace and throws a few more overloads in <br>
it. Then, what's in the namespace is dependent on which expansions are done, in <br>
which order. Throw in the inevitable circular references. Do people write code <br>
like that? Sure as shootin', they do, and they demand that it work, and file <br>
lots of bug reports about the erratic behavior.<br>
<br>
Next, consider a function body throwing a few more overloads in. Now, if the <br>
function body is compiled or not (and the compiler tries to avoid compiling <br>
bodies unless it has to) affects code that is outside of the function.<br>
<br>
C++ is full of stuff like that. The difference is, when code fails in some <br>
bizarre way, programmers blame themselves and throw money at Scott Meyers to <br>
educate them on how to avoid writing such code. For D, they blame me.<br>
<br>
The last time we fixed scope lookup to make it more complicated was with <br>
imports, and that took YEARS to sort out.<br>
<br>
So I'm a little reluctant to add features that will result in a rat's nest of <br>
problems I can neither explain nor fix, then someone will add 4000 <br>
incomprehensible lines to fix 2 cases and add 5 or 6 bizarre regressions in the <br>
process and people complain the compiler is unstable. :-)<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">I don't understand your claims that it would somehow become problematic or incomprehensible.</div><div dir="auto"><br></div><div dir="auto">Are you saying D's module system is incomprehensible?</div><div dir="auto"><br></div><div dir="auto">All we're asking for is that C++ namespaces do **nothing** except affect the mangling.</div><div dir="auto">We want the D module system to work verbatim, without any new behaviours or edge cases of any kind.</div><div dir="auto">All symbols are normal symbols in their normal D module namespaces, and resolved according to all the normal name lookup rules... just the symbol mangling will make it link properly, just like extern(C) and extern(C++).</div><div dir="auto"><br></div><div dir="auto">You're insisting we accept this complex solution you cooked up with new scopes introduced which are not module scopes, and introduce practical problems for most that try and use it, and then somehow tell us that we're asking to complicate the language when we beg for normal D behaviour as an option... It doesn't make sense.</div><div dir="auto"><br></div><div dir="auto">We don't want to 'open' or 'reopen' a namespace. We just want to tell the function how to mangle right.</div><div dir="auto"><br></div><div dir="auto">Show me "4000 incomprehensible lines" that were introduced by the existence of extern(C) or extern(C++)? Because asking for a namespace as nothing more than a mangling attribute will have no further effect than any other extern statement; that's the point!</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>