Perhaps we need to defer const for a while (3.0?)
Russell Lewis
webmaster at villagersonline.com
Thu Jan 3 09:08:26 PST 2008
Sean Kelly wrote:
> Russell Lewis wrote:
>>
>> Maybe it's time to stop spinning our wheels here and start making
>> progress on other things.
>
> Personally, I think the current design feels pretty good. It doesn't
> have rays of divine light shining from it like I hoped, but it's far
> better than C++ const in terms of understandability and utility. I
> think it says something that my complaints about it have been reduced to
> the use of 'invariant' as a keyword rather than anything substantial.
>
> Also, I do agree with Walter that if const is added it D it must be done
> sooner rather than later. Despite the comments to the effect that if
> you don't like const you don't have to use it, it really does break a
> lot of code, and the longer D is around the more difficult it will be to
> justify a significant breaking change.
I agree, but the thing that concerns me is that I suspect that the
reverse is also true: const, once in the language in some form, will be
*very* hard to change. I'm concerned that we will permanently enshrine
some sort of const into the language because it's the best one we have
so far, and then a few years later we will bemoan the fact that the
newer, better, "right" const just can't be retrofitted into the
language. But, of course, that is all speculation. You can't hold off
forever...
More information about the Digitalmars-d
mailing list