any news on const/invariant?

Oskar Linde oskar.lindeREM at OVEgmail.com
Thu Nov 29 16:19:00 PST 2007


Bill Baxter wrote:
> I agree the meaning of "readonly" is perfect, (and how on earth could it 
> mean "put this data in ROM"? It's physically impossible unless D was 
> some kind of EPROM burning software).  BUT those three extra letters 
> over "const" do bother me.  Because in function signatures it can often 
> be repeated  5 or more times.  So though probably in the minority, I'd 
> rather have it become "ro" if it's going to change.  There is some other 
> language that uses that.  I can't remember which one.

For function signatures, the "in" parameter attribute should save some 
typing (makes the parameters const). It is a pity const-by-default 
didn't work out.

> But anyway I'm not holding my breath waiting for Walter to make such a 
> change.

That would certainly be an unhealthy practice.

>> The only reason I keep posting about this must be because I am an 
>> incurable optimist. Or maybe I am just too stubborn to realize I've 
>> lost. Or maybe I'm just stuck at the romantic idea that the const 
>> issue could be resolved in a way that leaves const meaning constant. :P
> 
> Or D) all of the above.  :-)

I am afraid you might be right.

-- 
Oskar



More information about the Digitalmars-d mailing list