4 ms·
A generator may have multiple yields, if you call next(), then it comes from that call to the last yield call - based on the current execution context. The yiel
by lispm 9y ago
A generator may have multiple yields, if you call next(), then it comes from that call to the last yield call - based on the current execution context. The yield waits that the execution comes back to it.
The idea of function calls is much simpler - no yield magic necessary.