Getting the last element of an iterator

A singly-linked list has O(n) implementation for any list[n], so why not just implement getindex, and make it an <:AbstractVector?

I don’t think that anyone is saying that random access methods should not be implemented when they make sense, just that iterate is the wrong interface for this, and stretching it is not the right solution here.

2 Likes