
On Feb 12, 2010, at 2:33 PM, Greg Ewing wrote:
Masklinn wrote:
Though I'm not sure it's a very good idea for lists. Semantically, lists are to be iterated, not really to be indexed.
I don't think I agree that lists are meant primarily for iteration. Indexing them is a perfectly legitimate and useful thing to do.
However, I would agree that a list.get() operation with a default seems to be a rather rare requirement. Usually when you index a list, the index is generated by some algorithm that guarantees it's within range.
I can't remember ever wanting a list.get() myself, and if I ever did, I would be quite happy to write my own.
I concur. Put me down for a -1. Also, I think this idea was discussed once or twice here before and it got shot down then too. Raymond