I just got it! (invariant/const)

Georg Wrede georg at nospam.org
Thu Apr 10 08:16:01 PDT 2008


Lionello Lunesu wrote:
> 
> "Jason House" <jason.james.house at gmail.com> wrote in message 
> news:ftiuj8$mob$1 at digitalmars.com...
> 
>> Georg Wrede Wrote:
>>> Simen Kjaeraas wrote:
>>> > On Wed, 09 Apr 2008 15:40:37 +0200, Janice Caron wrote:
>>>
>>> >> You know that. I know that. Why would anyone think it strange?
>>> >
>>> > I think it is because invMemberFunc is invariant. Many read this as
>>> > "will not change anything", even though it is not what it means.
>>>
>>> I seriously think the problem is with the phrase "invMemberFunc is
>>> invariant".
>>>
>>> This leads people to think invariantness is a property of the function,
>>> instead of it merely requiring an invariant "this".
>>>
>>> Maybe we should figure out another way of stating it.
>>
>> Is that really the best solution?  Why not have do what people nievely 
>> think it does?  The code optimizer would benefit from that as well.
> 
> I agree.. And one less keyword, which, it seems, is a goal in itself.

I wasn't thinking of changing D, I was thinking more what we should 
*say* when we talk about invariantness and functions.

The phrase "f is invariant" really does not say that it wants something 
"invariant". In English it says that "there is a property invariantness, 
that f is". It's like saying somebody is Chinese. That is not the same 
as saying she wants Chinese food.

Any newcomer to this NG who doesn't have an extensive cultural 
background in C-like languages, will have a hard time before he realises 
that "f is invariant" actually only means "f loves an invariant 'this'".



More information about the Digitalmars-d mailing list