DIP 1024--Shared Atomics--Community Review Round 1

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.no
Sun Oct 13 05:51:57 UTC 2019

On Sunday, 13 October 2019 at 03:49:17 UTC, Manu wrote:
> On Sat, Oct 12, 2019 at 8:45 PM Ola Fosheim Grøstad via 
> Digitalmars-d <digitalmars-d at puremagic.com> wrote:
>> Well, I understand what you mean, but if you can achieve the 
>> same effect by hiding, then it is syntactical in nature.
> We can't though.

Assume that symbols prefixed by @trusted_ are only visible in 
@trusted code. Then you can define @trusted_unwrap that returns a 
reference to the unwrapped type.

Then you have what you need for a simple solution to a library 
version of shared.

> Not at this time. And I'm not sure what your point is... does 
> const have any effect in generated code? (it does not)

Const could also be done as a library wrapper, but that would 
require full fledeged meta programming and strong deductive 
functionality. So not realistic for D.

>> If not,
>> then it is just a way to bypass (break) the type system on a
>> syntactical level.
> I don't understand this.. how is it bypassing/breaking the type 
> system?

If you need a cast to make use of shared...

More information about the Digitalmars-d mailing list