-
Notifications
You must be signed in to change notification settings - Fork 1.9k
yieldAll and recursive generators #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm currently investigating this. As to the tail-recursive generators, seems like we can only achieve that using
As far as I understand, there's no other way to learn whether a nested iterator yield is the last suspension in the block and the continuation is actually a NOP that will immediately finish the coroutine block. I guess it would require some continuation metadata (though not much). Or is there already a way to learn that? |
|
Note that the mentioned nested iterator optimization is not implemented. |
It actually is conceptually available with suspending functions in even nicer way:
then do |
更改《组合挂起函数》中的表述
Investigate whether it's possible to implement efficient tail-recursive generators with
yieldAll
suspension function and the nested iterators technique, described here: https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/specsharp-iterators.pdfThe text was updated successfully, but these errors were encountered: