square/flow

Make it clearer which end of the Flow history stack is the top

zach-klippenstein opened this issue · 2 comments

It's not obvious that we treat the front of the History list as the top of the stack. You can always dig into the code to find out, but it should be easier to just read without knowing how Flow works under the hood.

I propose deprecating History#iterator() (and History.Builder, and #reverseIterator()) and replace them with something like Iterable<Object> framesTop() and Iterable<Object> History#framesFromBottom().

This also makes using reverseIterator much more idiomatic, since you can just use a for each loop.

Got the method names wrong, will follow up with another PR.