Effect Handler Stack Traversal Order

Hi, I was reading through the Mini-Pyro and Poutine tutorials, but am stuck on something about the traversal of the effect handler stack that doesn’t make sense to me.

From the code examples, we append effect handlers to the end of the stack/list, so that later handlers are at the end of the stack like:
[‘first handler’, ‘second handler’, …, ‘last handler’]

Then the tutorials say we traverse the stack by calling .process_message starting with the first handler and going up the stack. Then we call .postprocess_message starting from the top (last handler) and going back down the stack.

However, the problem I’m running into is that the code provided seems to do the opposite of this. It reverses the stack/list and iterates through that, which means we would call process_message starting at the top of the stack (last handler) instead of the bottom, since reversing the stack gives us this order:
[‘last handler’, …, ‘second handler’, ‘first handler’] and then iterating through this would be like starting at the top (not bottom) of the stack.

Not sure if I’m missing something here? The syntax I’m using is just for a list since mini-pyro implements the stack as a list. It appends to the end of the list, but then reversing this list causes the end to be the beginning, and makes us therefore start iterating at the top of the stack (with the last handler), right?

Ok, I think I may have figured out the issue. I think when they refer to the bottom of the Pyro stack in the tutorial, they’re actually meaning the end of the list (and the top of a generic stack). So while the last item in a generic stack is usually referred to as being the top item (i.e., we stack items on top), the tutorial is referring to it as the bottom item of the effect handler stack. I think this is the issue and what was causing the confusion.