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?