logoalt Hacker News

my-next-accounttoday at 9:06 AM0 repliesview on HN

That's right! I made the example in such a way that it is obvious what the bug is, for pedagogical reasons :-). This particular bug is a bit trickier to spot when you have more complex programs, and is something that I have seen in real (large) codebases. Your inner/outer arena sounds exactly like the same thing, though?

Generally, it's best to avoid the rewind trick, IMO, it makes it difficult to create composable programs.