Has this usage of async / await in C# been discovered before? [closed]

余生长醉 提交于 2019-11-30 14:48:21

yield return and await/async are just different specialized forms of coroutines. You've shown that you can (essentially) implement yield return using await/async, and I would not be surprised to find that it were possible the other way around. I'm sure that they are implemented in a very similar manner.

In practice, of course, I would not use await/async for iteration, since yield return is much simpler and more clear.

So,

  1. You can probably take this "abuse" as far as you want.
  2. Not sufficiently familiar with F# to answer.
  3. No, but IIRC the features are implemented in more or less the same way.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!