No, and that's the entire problem. You do not know when the increment will happen, that is specifically left undefined.
It is documented to be undefined (as you can't know when "after" will be), but the documentation is wrong ("before" is reality: the old value is stored in a temporary SV).
(It was left undefined in C to give implementers of compilers all sorts of freedom to optimize it - idem for Perl)
Perl will never be able to optimize $foo++ for real scalars, because they can be tied or overloaded at runtime. With Perl 6, when there are variables that are numbers but can never become a real scalar, maybe it can be optimized.
- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.