Perhaps we need to defer const for a while (3.0?)

Bruce Adams tortoise_74 at yeah.who.co.uk
Thu Jan 3 16:53:43 PST 2008


On Thu, 03 Jan 2008 17:08:26 -0000, Russell Lewis  
<webmaster at villagersonline.com> wrote:

> 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...

It depends on the language (designer) and the community. Larry Wall seems  
unafraid
and perhaps even keen on breaking changes (Perl apocolypses  -  
http://dev.perl.org/perl6/doc/apocalypse.html).



More information about the Digitalmars-d mailing list