Bruno Medeiros:

> The good news is that I suspect the fields used for 
> opEquals/opCmp/opHash in any class are unlikely to be fields that are 
> computed lazily. It's just a guess though, anyone have examples otherwise?

If I have a string type, I'd like to compute its hash value lazily, the first 
time I need it. Computing it requires time, it's useful for sets and 
associative arrays, but being the string immutable the result doesn't change, 
so you want to compute it only once. So only the array of chars is immutable, 
while the hash is computed lazily and is not immutable (it 's "lazily 
immutable").

Bye,
bearophile

Reply via email to