Greetings

Having coded a multithreaded library in D, I sorely miss headcost like specifier.

The library code dealt with lots of composite class object hierarchy where many element objects of a parent are *effectively immutable*. You build an effectively immutable object in the constructor of the parent class and then you are done since you do not assign to these object handles again. As a result there is no need to lock the parent object while accessing an *effectively immutable* object. The parent as well as child objects are mutable otherwise.

Dlang's immutable and const do not provide such a contract.

So +1 for headconst if this specifier can be used with class elements as well and not just in the function parameter list.

- Puneet

Reply via email to