-
Notifications
You must be signed in to change notification settings - Fork 419
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
Return was a mistake #689
Labels
Comments
We also can have |
This has all been discussed, including choice of names, in #615. /cc @MitchBodmer |
/remind me about closing this in one week if there are no further comments. |
@atifaziz set a reminder for Nov 21st 2019 |
👋 @atifaziz, about closing this if there are no further comments. |
Closing as there's been no follow-up. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#636 should not have been merged.
Return
is an awful method namereturn
is a c# instruction, and use this word for a method is a really bad ideaReturn
doesn't give any clue of what the methods dousing static MoreEnumerable;
it's just not readable:It's about building a
IEnumerable
, it can be generalized and that should beMoreEnumerable.From
(see #690) with different overload (param T[]
being the start point).The single item case can be optimized later.
If we need a special name for it, it should be something like
Encapsulate
,Wrap
,Pack
,Box
, ... Anything that bring the idea of building a container around the element.Return
is an alias for a simple stuffMoreEnumerable.Return
is almostx => new[] { x };
it does not even shorten the summoning.What about immutable list stuff ?
If the target functionality was to build immutable list, just generalize it:
return
IReadonlyList
is not enough since it doesn't provideCopyTo
optimized methods.The text was updated successfully, but these errors were encountered: