2017-04-19 15:43 GMT-03:00 Stephane Ducasse <stepharo.self@gmail.com>:
Hi
I have
#(#Object #subclass: #Point #instanceVariableNames: 'x y' #classVariableNames: '' #package: 'Kernel-BasicObjects') and I would like to select on the second elements.
I was thinking that
#(#Object #subclass: #Point #instanceVariableNames: 'x y' #classVariableNames: '' #package: 'Kernel-BasicObjects') selectEvery: [ :i | i \\ 2 = 0 ] could be a nice iterator.
What do you think?
I think I wouldn't add a new enumerating selector to the core classes. If it needs to be there, I would replace it by #keysSelect: So it would work to select based on the keys of the receiver (indexes for sequenced collections) but also would work as it does for #keysAndValuesDo: implementors. Regards, -- Esteban.