> I'm looking at some old C# code and I found a line where a SortedList is
> being accessed with a negative index, like so:
>
> groups[-1];
>
> My C# skills must be getting rusty. How can that work? What does it do?
A SortedList is actually a dictionary -- the name is particularly poorly
chosen because the class is not very suitable for an *actual* sorted list
either.
The keys of a SortedList can be arbitrary objects; in this case, integers.
Those don't have to be nonnegative (or consecutive).
What you're thinking of is that the items can *also* be accessed by ordinal
[0..Count), but that's through the .GetByIndex() method.

Signature
J.