Const sucks

renoX renosky at free.fr
Tue Sep 11 15:04:55 PDT 2007


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

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