What is Invariant Good For?

Derek Parnell derek at psych.ward
Sat Aug 2 21:07:28 PDT 2008


On Sat, 02 Aug 2008 19:00:41 -0700, Walter Bright wrote:

> Sean Kelly wrote:
>> Same concepts, same syntax, but could you convince anyone to use
>> the language?
> 
> It's hard to find 3 people to agree on any one word for constant. I 
> might as well have used "refrigerator" to mean invariant.

Isn't this also because we are trying to use simple words to express subtly
different concepts. One concept is of something that, once it has been
given a value, can *never* have that value changed during the life of the
program, and another is that of something that cannot have its value
changed in certain circumstances, such as by a specific function or during
a specific period of time, etc ...

Simple words will never suffice, so we may as well use words which are
approximately right and just learn to associated them with their exact
meaning. Arguing over 'const' 'immutable', 'invariant', 'constant',
'constrained', 'fixed', 'final', 'hard', 'shell-encrusted-soft-core', ...
is pretty much a waste of precious time. It really does not matter; just
pick something, define it, and go with it.


-- 
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell



More information about the Digitalmars-d mailing list