News for hackers. Stuff that matters.
Re:Microfeatures I'd like to see in more languages by int_19h on Friday January 06, 2023 @05:26PM (#34282167)
All standard .NET collections with defined order and O(1) indexing support indexing backwards.

And no, it's not possible to do this using an extension method, unfortunately - there are no extension properties or indexers in C# (yet; it's something that keeps coming up). But then again, if and when they add extension indexers, this arrangement with a custom type is what'd allow you to write one that does backwards indexing on a collection type that doesn't support it out of the box.

There are no comments on this comment yet.