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

NuGet package for Range and Index #3126

Closed
lostmsu opened this issue Jan 25, 2020 · 6 comments
Closed

NuGet package for Range and Index #3126

lostmsu opened this issue Jan 25, 2020 · 6 comments

Comments

@lostmsu
Copy link

lostmsu commented Jan 25, 2020

So C# 8 is released, and .NET Framework support EoL is 2029, so I am targeting .NET Standard 2.0 for most old and new libraries alike. Which also means I can't really use ranges or the new indexing because

error CS0518: Predefined type 'System.Range' is not defined or imported

In the previous conversation about that topic it was mentioned, that System.ValueTuple NuGet support put an undue burden on the team and bloated the dependency list of many packages.

Well, I love the System.ValueTuple package. And I can assure you to a great length, that I would love Range and Index even more, because it is rarely that extreme performance is needed, but every day I'd take clean code over a mess of method calls with off-by-one errors.

So I urge you to reconsider the lack of a similar package. At the very least, put the types themselves there (which, BTW, would be 100% compatible with further additions, if you wish to add extra members supporting them to the rest of the framework). At least it would be possible to implement indexing for our own collections.

Previous issue for the reference (it deviated too far from the topic): #2148

@sharwell
Copy link
Member

Microsoft.Bcl.AsyncInterfaces already provides similar functionality for a different feature new for C# 8.

@huoyaoyuan
Copy link
Member

Pattern-based index and range expressions are added near the ship time of C# 8. Without this feature, out-of-band package cannot be actually used, since existing types have no member accepting them. But with this feature, it can be easily used.

@lostmsu
Copy link
Author

lostmsu commented Jan 31, 2020

@huoyaoyuan it is fine, that I can't use it on core types. Problem is: without a package I can't implement indexers with them in my types in a .NET Standard 2.0 assembly.

@lostmsu
Copy link
Author

lostmsu commented Feb 11, 2020

@jkotas should this issue be in dotnet/runtime instead? I'd love Microsoft.Bcl.Ranges

@jkotas
Copy link
Member

jkotas commented Feb 11, 2020

This is duplicate of dotnet/runtime#28285

@333fred
Copy link
Member

333fred commented Feb 12, 2020

Closing as a duplicate.

@333fred 333fred closed this as completed Feb 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants