Skip to content
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

Please support yield collection from IEnumerable #13852

Closed
Thaina opened this issue Sep 16, 2016 · 3 comments
Closed

Please support yield collection from IEnumerable #13852

Thaina opened this issue Sep 16, 2016 · 3 comments

Comments

@Thaina
Copy link

Thaina commented Sep 16, 2016

In addition to yield return from IEnumerable function. C# should be able to yield any other IEnumerable from inside

IEnumerable<int> GetInt()
{
    yield return 0;
    yield return 1;
    yield return 2;
    yield [3,4,5];
    yield return 6;
    yield return 7;
    yield return 8;
    yield Enumerable.Range(9,99);
}

Like yield* in js

@dsaf
Copy link

dsaf commented Sep 16, 2016

F# has this, it enables proper recursion as well: http://theburningmonk.com/2011/09/fsharp-yield-vs-yield

@alrz
Copy link
Member

alrz commented Sep 16, 2016

#15

@gafter
Copy link
Member

gafter commented Feb 15, 2019

Language design discussion now takes place at https://github.com/dotnet/csharplang . Please reopen there if you want to continue this. I am closing this as the discussion appears to be stale. See also dotnet/csharplang#378

@gafter gafter closed this as completed Feb 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants