Marcus
So sorry for this false accusation. It is proprietary in Squeak.
And even if it was Dan's idea to rename it, I'd like to learn more about the reasoning.
My understanding would be:
#do: iterates over a collection
#doWithIndex: iterates over a collection and also keeps track of the current index.
Sounds very consistent to me. the most important thing I want the machine to do is iterate over the collection, and the index thing is just a variant thereof.
#do: iterates over a collection
#withIndexDo: keeps track of the index while iterating over a collection
Sounds clumsy to me. Introduces incompatibilities for not much value. If people complained about #do: as not intentioon revealing and opted to rename it to something like #withEachDo: , then I could understand it. The variant could be #withEachDoIndexed:
But not that one ;-)
... but this is completely off-topic of course...
Joachim
Marcus Denker <marcus.denker@inria.fr> hat am 10. März 2015 um 14:32 geschrieben:
Sounds like a bad naming to me. I don't see why withIndexDo is any better. It even contradicts the order of the arguments. And it is Proprietary to Pharo.
No, if you look a the timeStamp it was done in 1997 by Dan.