On 5/12/2013 6:01 AM, Andrei Alexandrescu wrote:
Bartosz, Walter and I reached a similar design a few years ago. We just thought
it complicates things too much for what it does.

I've been working in the background on a scheme that can infer uniqueness. The beauty of it is it will not require visible language changes - it's just that things that didn't compile before now will. It won't solve all the problems, but I'm hoping it'll solve enough that the rest will not be more than a minor annoyance.

For a trivial example,

    shared p = new int;

would work, as 'new int' would be inferred to be unique, and a unique pointer can be implicitly cast to immutable or shared. This plays to D's strength with function purity, transitive const/immutable/shared, attribute inference, etc.

Reply via email to