3 ms·
Yup, I can see that! One issue I have is that my model of the stack is that "it's a literal _stack_ of frames. You pop them one by one, executing them." What
by Waterluvian 4y ago
Yup, I can see that! One issue I have is that my model of the stack is that "it's a literal _stack_ of frames. You pop them one by one, executing them."
What happens to a frame that you pause? Does it get set aside? Is it still on the stack?
- hundt 4y agoThis article[0] and a clarifying comment[1] answer the question for JS. I think it's the same for Python. Apparently your model (which was mine, too) is out of date! [0] https://hacks.mozilla.org/2015/05/es6-in-depth-generators/ https://hacks.mozilla.org/2015/05/es6-in-depth-generators/ [1] https://hacks.mozilla.org/2015/05/es6-in-depth-generators/#comment-17692 https://hacks.mozilla.org/2015/05/es6-in-depth-generators/#c...
- int_19h 4y agoThis kind of thing shows up around several other related PL features, so much so that it has a name: https://wiki.c2.com/?SpaghettiStack https://wiki.c2.com/?SpaghettiStack