August 06, 2018
On 8/6/2018 11:26 AM, tide wrote:
> What's your crossplatform workaround if I have a namespace named "version" or "package" ?

See my reply to Rick Cattermole.
https://digitalmars.com/d/archives/digitalmars/D/Is_there_any_good_reason_why_C_namespaces_are_closed_in_D_317277.html#N317507


> You also didn't mention your reasoning behind not including a way to use const pointers to mutable data.

That's a longstanding issue and has nothing to do with namespaces.


> How can you suggest DPP then go on to say you've never even used it or know how it is even used?

Because I have full confidence in Atila and Laeeth. I've also written such a translator myself (HTOD) so I know what they're capable of.
August 06, 2018
On Monday, 6 August 2018 at 20:35:37 UTC, Walter Bright wrote:
> On 8/6/2018 11:26 AM, tide wrote:
>> What's your crossplatform workaround if I have a namespace named "version" or "package" ?
>
> See my reply to Rick Cattermole.
> https://digitalmars.com/d/archives/digitalmars/D/Is_there_any_good_reason_why_C_namespaces_are_closed_in_D_317277.html#N317507

But that's not currently implemented is it? Your proposed solution adds an exception to the rule that just increases complexity of the language. No where else does "__" remove itself from the name it is used with. With the syntax extern(C++, "...") it is more easily understood, no crazy exceptions need to be made.

>> You also didn't mention your reasoning behind not including a way to use const pointers to mutable data.
>
> That's a longstanding issue and has nothing to do with namespaces.

That's just a deflection, we are talking about C++ name mangling, not namespaces. How do you mangle const pointers to mutable data in D to be able to call C++ ? You don't need to implement the feature, you just need a way to create the C++ mangle, which there is none. The only way is to change C++ code, like you said, telling people to rewrite their code is never, ever going to work.



August 06, 2018
On 8/6/2018 3:19 PM, tide wrote:
> That's just a deflection,

1. I'm only here to help, and am not interested in scoring debate points.

2. To bring up other topics, please start a new thread. Especially since this one is quite voluminous.
August 06, 2018
On 8/5/2018 9:53 PM, Manu wrote:
> If we produce a DIP to fix this, will you reject it in principle?

Producing a DIP is a good idea, it provides an anchor point for any future discussion of the topic, rather than the tangle and noise that is this thread. It is an ample opportunity to put the best foot forward on your ideas.

I'm not going to categorically say we'll reject it, but will say that you'll need to make a more compelling case, and a DIP is the right method for that. Please keep in mind that a good DIP will address the counterarguments and other methods of solving the issue.

As this thread affirms, trying to design things in the forums doesn't work very well, and I should have asked for a DIP in the first place.

August 06, 2018
Let's see if we can find some common ground.

The boilerplate I suggested seems to enable DPP to generate working code that behaves "as if" the namespace scope is not there, even for nested namespaces.

Is this correct?

August 07, 2018
On Tuesday, 7 August 2018 at 02:25:32 UTC, Walter Bright wrote:
> Let's see if we can find some common ground.
>
> The boilerplate I suggested seems to enable DPP to generate working code that behaves "as if" the namespace scope is not there, even for nested namespaces.
>
> Is this correct?

Yes, but only for a single instance of the namespace.
In the general case no, see the first reply in https://forum.dlang.org/post/xdaedmlbbqtztiqcwxll@forum.dlang.org
August 06, 2018
On 8/6/2018 8:14 PM, Nicholas Wilson wrote:
> Yes, but only for a single instance of the namespace.
> In the general case no, see the first reply in https://forum.dlang.org/post/xdaedmlbbqtztiqcwxll@forum.dlang.org

The idea is to not have a namespace, I don't see what making an alias to a namespace has to do with it.
August 07, 2018
On Tuesday, 7 August 2018 at 05:58:17 UTC, Walter Bright wrote:
> On 8/6/2018 8:14 PM, Nicholas Wilson wrote:
>> Yes, but only for a single instance of the namespace.
>> In the general case no, see the first reply in https://forum.dlang.org/post/xdaedmlbbqtztiqcwxll@forum.dlang.org
>
> The idea is to not have a namespace

That is what we have been arguing for all thread...

> I don't see what making an alias to a namespace has to do with it.

That was your suggested workaround, was it not? If not you have _really_ lost me.


August 07, 2018
On Tuesday, 7 August 2018 at 02:25:32 UTC, Walter Bright wrote:
> Let's see if we can find some common ground.
>
> The boilerplate I suggested seems to enable DPP to generate working code that behaves "as if" the namespace scope is not there, even for nested namespaces.
>
> Is this correct?

Almost.

extern(C++, noise1.noise2.noise3)
void fun();
alias fun = noise1.noise2.noise3.fun;
void main() { fun(1); }

                   Except the full name bleeds to the user
                                     |
                                     |
                                     V
my.d(4): Error: function my.noise1.noise2.noise3.fun() is not callable using argument types (int)

Would you prefer to:
1) Keep as is, let it bleed
2) Suppress namespaces when printing error messages
3) Never generate the namespace in the first-place

August 07, 2018
On 8/7/2018 12:08 AM, Nicholas Wilson wrote:
>> I don't see what making an alias to a namespace has to do with it.
> That was your suggested workaround, was it not?

No, it was not. It was about making an alias to the members of the namespace.