extern(C++, ns) is wrong

Manu turkeyman at gmail.com
Thu Sep 13 22:47:02 UTC 2018


On Thu, 13 Sep 2018 at 04:46, Danni Coy via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
>
> On Thu, Sep 13, 2018 at 5:14 PM Jonathan M Davis via Digitalmars-d <digitalmars-d at puremagic.com> wrote:
>>
>> The entire point of having extern(C++, "NS") would be to make it so that the
>> _only_ thing that it would affect would be the name mangling. Everything
>> else is exactly the same behavior as it would be if you had the same
>> functions as extern(D). It would be up to the programmer to organize them
>> exactly like it is with pure D code. If you think that putting two functions
>> in the same module is too risky, then you can put them in separate modules,
>> but it certainly isn't going to be forced on you unless they actually
>> conflict. The fact that functions are extern(C++) would have no impact on
>> that whatsoever.
>
> Yeah I get all this. It just seems to me that the downsides of extern(C++,"ns") from Walter's point of view could be handled by the compiler at the cost of a bit of flexibility.

What are the 'downsides' you refer to? And what 'flexibility' is lost?
The whole point is to gain flexibility. There's definitely no loss of
flexibility on the table here ;)

> I would like to know how difficult that would be to do and whether that would be more acceptable to Walter than what is being being proposed.

You'll need to elaborate. What is being proposed is the simplest
possible, most plainly obvious,
let's-not-introduce-unwieldy-edge-cases solution.

Walters named scope should be an unrelated and parallel feature if he
really wants it.


More information about the Digitalmars-d mailing list