Const sucks

renoX renosky at free.fr
Tue Sep 11 22:54:43 PDT 2007


renoX a écrit :
> Derek Parnell a écrit :
>> Thank you. I do remember now ... silly how I couldn't get that from the
>> keywords.
>>
>> 'const' is sort of a locally write protected.
>> 'invariant' is globally write protected.
> 
> So am I, each time I see 'invariant' I try to think 'value', which is 
> much more easy to associate with the correct properties:
> values are immutable and you can't take the address of a value either, 
> exactly like 'invariant'.

Oops, I didn't see the change that now you can take the address of an 
invariant.

So now invariant != value, argh.

renoX
> 
> For const, I've not found an easy to memorize keyword, but as D's const 
> are like C++ const (AFAIK), it's not an issue for me.
> 
> 
> Of course with a Limbo syntax for variable declaration instead of the 
> weird C-like, the parenthesis would be less(not?) useful..
> 
> renoX



More information about the Digitalmars-d mailing list