in reply to Re: Re: Incrementing a Hash Value
in thread Incrementing a Hash Value
The two of you obviously mean different things by "defined".
Abigail says that $i = $i++ is undefined because it is not declared in the Perl (or C) language specs. Juerd says that it is defined because it has consistently behaved in the same way for as long as anyone can remember.
In my experience, Abigail's definition of definedness is the one most commonly (and, many would argue, most properly) used in this context. While the behaviour of $i = $i++ may be deterministic, the fact remains that its behaviour is merely an artifact of how it is implemented and should not be relied upon, because, without any implementation-independent specification of its behaviour, next release of perl is free to arbitrarily change it for any reason (or no reason at all).
|
---|