pyro
pyro copied to clipboard
Incorrect stack terminology in Poutine and minipyro.py
The Poutine example page and the minipyro.py example script flip the standard terminology of the stack data structure. One adds and removes from the top of the stack, but in these pages this is flipped. As pedagogical resources, this inverted terminology adds unnecessary confusion.
For example, when iterating over the stack in minipyro.py:
PYRO_STACK is reversed so that effect handlers higher in the stack are first applied.
and in http://pyro.ai/examples/effect_handlers.html#Interlude:-the-global-Messenger-stack:
Messenger.__enter__
appends aMessenger
to the end (the bottom) of the global handler stack
@lwiklendt moved to the Pyro repository, since the content in question is stored here. Feel free to open a PR with changes to those examples that you think would clarify the terminology.
@lwiklendt Thanks, I may be blamed here, as I at one point insisted that "stacks can only be mutated at the top: pushed onto the top or popped off of the top", but we only ever got part way through updating docs. (Pancake intuition 🥞 🤷 )
We'd happily accept PRs clarifying or making docs more consistent