The main reason is that implicit state that must be resetted explicitly is a bad idea. Especially if you compare it to a lexical variable, which provides state explicitly, and is resetted implicitly at the end of the scope.
For example if an exception is thrown before you do the reset, the next call of your function will return wrong results.
And what if there are multiple flip-flops in scope? How do you control which one is reset?
In reply to Re^5: flip-flop flop
by moritz
in thread flip-flop flop
by morgon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |