pyro icon indicating copy to clipboard operation
pyro copied to clipboard

Incorrect stack terminology in Poutine and minipyro.py

Open lwiklendt opened this issue 2 years ago • 2 comments

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 a Messenger to the end (the bottom) of the global handler stack

lwiklendt avatar May 13 '22 03:05 lwiklendt

@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.

eb8680 avatar May 13 '22 14:05 eb8680

@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

fritzo avatar May 13 '22 14:05 fritzo