On Sun., 29 Jul. 2018, 12:40 am Walter Bright via Digitalmars-d, <
digitalmars-d@puremagic.com> wrote:

> On 7/28/2018 11:06 PM, Nicholas Wilson wrote:
> > Then again I don't see any (non philosophical/compiler front end
> internal) issue
> > why you can't reopen a namespace. D is supposed to be pragmatic, after
> all.
>
> Consider if a template reopens a namespace and throws a few more overloads
> in
> it. Then, what's in the namespace is dependent on which expansions are
> done, in
> which order. Throw in the inevitable circular references. Do people write
> code
> like that? Sure as shootin', they do, and they demand that it work, and
> file
> lots of bug reports about the erratic behavior.
>
> Next, consider a function body throwing a few more overloads in. Now, if
> the
> function body is compiled or not (and the compiler tries to avoid
> compiling
> bodies unless it has to) affects code that is outside of the function.
>
> C++ is full of stuff like that. The difference is, when code fails in some
> bizarre way, programmers blame themselves and throw money at Scott Meyers
> to
> educate them on how to avoid writing such code. For D, they blame me.
>
> The last time we fixed scope lookup to make it more complicated was with
> imports, and that took YEARS to sort out.
>
> So I'm a little reluctant to add features that will result in a rat's nest
> of
> problems I can neither explain nor fix, then someone will add 4000
> incomprehensible lines to fix 2 cases and add 5 or 6 bizarre regressions
> in the
> process and people complain the compiler is unstable. :-)
>

I don't understand your claims that it would somehow become problematic or
incomprehensible.

Are you saying D's module system is incomprehensible?

All we're asking for is that C++ namespaces do **nothing** except affect
the mangling.
We want the D module system to work verbatim, without any new behaviours or
edge cases of any kind.
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++).

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.

We don't want to 'open' or 'reopen' a namespace. We just want to tell the
function how to mangle right.

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!

>

Reply via email to