Ask HN: Is there a name for the concept of "value changes upon read"?
I'm trying to think of a name to use to describe a value which will reliably change upon being read. Not the nature of the change, but naming this concept of change-upon-read.
For example, I have this, complete with syntax error: class Alternator{ bool value; implicit cast(bool) { get { return value = !value; } } }
I know that this phenomenon exists in quantum physics - that the state of a particle will change due to the act of reading the particle's state - but I don't know if there is a term for it, though if there is it would be ideal.
I figure naming it is important, because otherwise i'm left with mystery object with dodgy tacit behaviour, which is not cool for the uninitiated.
9 comments
[ 4.3 ms ] story [ 35.1 ms ] threadIt certainly necessitates careful application, but does have it's uses in reducing copypasta.
Good question but programming languages avoid this, you would have to coin your own.