[dmd-concurrency] tail-shared by default?

Steve Schveighoffer schveiguy at yahoo.com
Fri Jan 8 14:07:35 PST 2010


----- Original Message ----

> From: Walter Bright <walter at digitalmars.com>
> 
> 
> Steve Schveighoffer wrote:
> > ----- Original Message ----
> > 
> >  
> >> From: Walter Bright 
> >> 
> >> Steve Schveighoffer wrote:
> >>    
> >>> The only caveat is, we would *need* to change the semantics of shared so 
> that      
> >> you can have a non-shared reference to a shared class instance easily.
> >> 
> >> That's the so-called "tail-shared" problem. We tried (hard) to make 
> "tail-const" work, where the reference is mutable but the contents were const. 
> It sounds simple, but just does not work in a language with implicit reference 
> semantics.
> >>    
> > 
> > Yes, but this isn't const, it is shared.
> 
> To the type construction system, they are handled the same. Tail-shared will 
> have the same insurmountable problems that tail-const had.

They don't have to be handled the same.  Const is completely different from shared with different problems and different solutions.  If shared was the same as const, we wouldn't be discussing it right now, it would be done.

> 
> > 
> > What do you think about this?
> > 
> > 
> >  
> 
> I tried desperately to make tail-const work. It wasn't going to, and neither is 
> tail-shared for the same reasons.

It's too bad that tail-const wouldn't work.  I don't think tail-shared presents the same problems.  Please don't dismiss all the points I wrote just because of past failures.  They are new ideas that don't apply to const at all.

-Steve



      


More information about the dmd-concurrency mailing list