Proposal to make "shared" (more) useful

Arafel er.krali at gmail.com
Fri Sep 14 12:00:19 UTC 2018


On 09/14/2018 01:37 PM, Kagamin wrote:
> On Friday, 14 September 2018 at 11:13:00 UTC, Arafel wrote:
>> As I recently discovered, "__gshared" means "static", so not so easy 
>> to use for class instance members. In fact, that's exactly what I'd 
>> like to have.
> 
> __gshared is for global storage. If you don't use global storage, you 
> can simply not qualify anything shared, and you won't have to deal with it.

Sure, then let's remove the "shared" keyword altogether.

Now, seriously, I understand that manually managed shared classes are 
not the preferred paradigm for many (most?) D programmers, and I'm not 
even against removing it altogether and then making it clear that it's 
not supported.

But in my view this situation where there *seems* to be support for it 
in the language, but it's just a minefield once you try, just gives a 
bad impression of the language.

Since I think this is commonly agreed, I was only trying to suggest a 
possible way to improve it (see my other messages in the thread), that's 
it.

I'll anyway keep working with (against) "shared" and finding workarounds 
because for me the benefits in other areas of the language compensate, 
but I'm sure many people won't, and it's a pity because I think it has 
the potential to become something useful.

A.


More information about the Digitalmars-d mailing list