Jump to page: 1 24  
Page
Thread overview
Support alias this in module scope?
May 23, 2018
Manu
May 23, 2018
Stefan Koch
May 23, 2018
Manu
May 23, 2018
12345swordy
May 23, 2018
rikki cattermole
May 23, 2018
Manu
May 23, 2018
VectorThis
May 23, 2018
Manu
May 23, 2018
12345swordy
May 23, 2018
H. S. Teoh
May 23, 2018
12345swordy
May 23, 2018
Manu
May 23, 2018
H. S. Teoh
May 24, 2018
biocyberman
Online impersonation
May 23, 2018
Bastiaan Veelo
May 24, 2018
Dukc
May 24, 2018
rikki cattermole
May 24, 2018
John Colvin
May 24, 2018
Patrick Schluter
May 24, 2018
Dukc
May 24, 2018
Jonathan M Davis
May 24, 2018
Dukc
May 24, 2018
rikki cattermole
May 24, 2018
12345swordy
May 23, 2018
Atila Neves
May 23, 2018
Jonathan Marler
May 24, 2018
Dukc
May 24, 2018
Rubn
May 22, 2018
Okay, I'm still really angry about the stupid stupid decision to make C++ namespaces into scopes rather than just a detail used for mangling, with absolutely no consultation of the community, in particular the target audience, who are unanimously annoyed as far as I can tell...

I'm unsatisfied by the work-arounds to make the situation not-suck, but I think I have an idea that would pacify me...

If we can use `alias this` to mirror an entire C++ namespace into the location we want (ie, the scope immediately outside the C++ namespace!!), then one sanitary line would make the problem quite more tolerable:

extern(C++, FuckOff)
{
  void bah();
  void humbug();
}
alias this FuckOff;  // <-- symbols are now aliased where they should
have been all along



(count the seconds until the reply that says to use reflection to scan the scope, and use a mixin to... blah blah)
May 23, 2018
On Wednesday, 23 May 2018 at 03:44:36 UTC, Manu wrote:
> Okay, I'm still really angry about the stupid stupid decision to make C++ namespaces into scopes rather than just a detail used for mangling, with absolutely no consultation of the community, in particular the target audience, who are unanimously annoyed as far as I can tell...
>
> I'm unsatisfied by the work-arounds to make the situation not-suck, but I think I have an idea that would pacify me...
>
> If we can use `alias this` to mirror an entire C++ namespace into the location we want (ie, the scope immediately outside the C++ namespace!!), then one sanitary line would make the problem quite more tolerable:
>
> extern(C++, FuckOff)
> {
>   void bah();
>   void humbug();
> }
> alias this FuckOff;  // <-- symbols are now aliased where they should
> have been all along
>
>
>
> (count the seconds until the reply that says to use reflection to scan the scope, and use a mixin to... blah blah)

After thinking about it for a few minutes I do believe this is a reasonable approach.
I am in favor of module-level alias this.

The reason name-spaces create a scope is because they are essentially implemented via structs.
May 22, 2018
On 22 May 2018 at 20:53, Stefan Koch via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
> On Wednesday, 23 May 2018 at 03:44:36 UTC, Manu wrote:
>>
>> Okay, I'm still really angry about the stupid stupid decision to make C++ namespaces into scopes rather than just a detail used for mangling, with absolutely no consultation of the community, in particular the target audience, who are unanimously annoyed as far as I can tell...
>>
>> I'm unsatisfied by the work-arounds to make the situation not-suck, but I think I have an idea that would pacify me...
>>
>> If we can use `alias this` to mirror an entire C++ namespace into the location we want (ie, the scope immediately outside the C++ namespace!!), then one sanitary line would make the problem quite more tolerable:
>>
>> extern(C++, FuckOff)
>> {
>>   void bah();
>>   void humbug();
>> }
>> alias this FuckOff;  // <-- symbols are now aliased where they should
>> have been all along
>>
>>
>>
>> (count the seconds until the reply that says to use reflection to scan the scope, and use a mixin to... blah blah)
>
>
> After thinking about it for a few minutes I do believe this is a reasonable
> approach.
> I am in favor of module-level alias this.
>
> The reason name-spaces create a scope is because they are essentially implemented via structs.

I know, but it shouldn't be... they should just be normal extern(C++) functions with an extra detail in the attribute for mangling.
May 23, 2018
On Wednesday, 23 May 2018 at 03:44:36 UTC, Manu wrote:
>
> extern(C++, FuckOff)
> {
>   void bah();
>   void humbug();
> }
> alias this FuckOff;  // <-- symbols are now aliased where they should
> have been all along
>
>

Knock it off with sex talk here.

May 23, 2018
On 23/05/2018 4:29 PM, 12345swordy wrote:
> On Wednesday, 23 May 2018 at 03:44:36 UTC, Manu wrote:
>>
>> extern(C++, FuckOff)
>> {
>>   void bah();
>>   void humbug();
>> }
>> alias this FuckOff;  // <-- symbols are now aliased where they should
>> have been all along
>>
>>
> 
> Knock it off with sex talk here.

This is Manu and he is highly annoyed, you don't need to tell him off.

May 22, 2018
On 22 May 2018 at 21:31, rikki cattermole via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
> On 23/05/2018 4:29 PM, 12345swordy wrote:
>>
>> On Wednesday, 23 May 2018 at 03:44:36 UTC, Manu wrote:
>>>
>>>
>>> extern(C++, FuckOff)
>>> {
>>>   void bah();
>>>   void humbug();
>>> }
>>> alias this FuckOff;  // <-- symbols are now aliased where they should
>>> have been all along
>>>
>>>
>>
>> Knock it off with sex talk here.
>
>
> This is Manu and he is highly annoyed, you don't need to tell him off.

Sure he does! It's a fair call.
May 23, 2018
On Wednesday, 23 May 2018 at 04:38:48 UTC, Manu wrote:
>
> Sure he does! It's a fair call.

Hey, it could be worse, you could have wrote this below instead..
(then imagine the chaos that would unfold on the D forums)

extern(C++, SomethingHere)
{
  void penetration();
  void private();
}



May 22, 2018
On 22 May 2018 at 22:06, VectorThis via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
> On Wednesday, 23 May 2018 at 04:38:48 UTC, Manu wrote:
>>
>>
>> Sure he does! It's a fair call.
>
>
> Hey, it could be worse, you could have wrote this below instead.. (then imagine the chaos that would unfold on the D forums)
>
> extern(C++, SomethingHere)
> {
>   void penetration();
>   void private();
> }

Nar, I didn't mean to start a thing...
May 23, 2018
On 5/23/18 1:49 AM, Manu wrote:
> On 22 May 2018 at 22:06, VectorThis via Digitalmars-d
> <digitalmars-d@puremagic.com> wrote:
>> On Wednesday, 23 May 2018 at 04:38:48 UTC, Manu wrote:
>>>
>>>
>>> Sure he does! It's a fair call.
>>
>>
>> Hey, it could be worse, you could have wrote this below instead..
>> (then imagine the chaos that would unfold on the D forums)
>>
>> extern(C++, SomethingHere)
>> {
>>    void penetration();
>>    void private();
>> }
> 
> Nar, I didn't mean to start a thing...
> 

I'm just going to warn everyone here that one person is posting as KingJoffrey, VectorThis, Grady Booch, FuckYou, and in this thread he is impersonating 12345swordy, and in others he has impersonated WalterBright as well.

-Steve
May 23, 2018
On Wednesday, 23 May 2018 at 03:44:36 UTC, Manu wrote:
> Okay, I'm still really angry about the stupid stupid decision to make C++ namespaces into scopes rather than just a detail used for mangling, with absolutely no consultation of the community, in particular the target audience, who are unanimously annoyed as far as I can tell...

+1

I see no reason for it. It's just mangling after all.

Atila

« First   ‹ Prev
1 2 3 4