On Tuesday, 16 February 2016 at 11:27:56 UTC, Dicebot wrote:
On 02/16/2016 12:48 AM, Walter Bright wrote:
rears its head again :-)

Head Const is what C++ has for const, i.e. it is not transitive, applies to one level only. D has transitive const.

What head const will do for us:

1. make it easy to interface to C++ code that uses const, as currently it is not very practical to do so, you have to resort to pragma(mangle)

2. supports single assignment style of programming, even if the data is otherwise mutable

The downside is, of course, language complexity.

Moderately skeptical here. Adding features to the language for the sake of C++ compatibility is good way to ensure C++ compatibility will be its only domain of triumph. I'd expect more justification for users who don't care about C++ but want language which doesn't collapse under own weight.

`@mutable` OTOH would be a useful for both C++, reference counting, caching, lazy initialization... But we need to find a way to keep most of the existing guarantees, especially concerning shareability.

Reply via email to