On 12/05/2011 02:16 AM, Graham St Jack wrote:
My vote is for something like immutable(Object) ref, as Andrew suggested
earlier. This would allow mutable references to immutable objects to be
passed through a message channel without nasty typecasting.

std.typecons.Rebindable has always been an ugly hack that doesn't quite
do the job. Certainly every attempt I have made to use it has ended
unhappily, and I end up redesigning to not pass objects between threads.

You are right of course. I was just pointing out that there is already an ugly hack of the same kind in Phobos.


What is the status of the immutable(Object) ref proposal? Is it on the
list of things to do, or is it ruled out? If it is ruled out, then what
is the superior proposal?


It is not fully implemented and apparently Walter would like a different solution, because it is quite ugly. But I think there hasn't been another proposal yet.

There is a pull request that partly implements it:
https://github.com/D-Programming-Language/dmd/pull/3

Reply via email to