[Pharo-dev] In the quest of a new iterator :)
btc at openinworld.com
Thu Apr 20 11:06:22 EDT 2017
On Thu, Apr 20, 2017 at 3:17 AM, Stephane Ducasse <stepharo.self at gmail.com>
> Iterators are powerful and avoid that we all reinvent the wheel in our own
> About keySelect: I do not see the point to convert a large collection into
> a dictionary then do yet another pass.
> To me it looks like a hack.
> I implemented
> (selectFirst selectSecond) as helpers.
> and also unzip all in one pass.
> Now I have no problem to keep them for me but to me this is the wrong
> self assert: (#(#Object #subclass: #Point #instanceVariableNames: 'x y'
> #classVariableNames: '' #package: 'Kernel-BasicObjects') selectEveryFirst)
> asArray equals: #(#Object #Point 'x y' '' 'Kernel-BasicObjects')
selectEveryFirst seems a strange name, not indicating the skip amount.
The first of every three? or four? As it stand, technically I'd think its
be equals: (#(#Object #subclass: #Point #instanceVariableNames: 'x y'
#classVariableNames: '' #package: 'Kernel-BasicObjects')
+1 to Peter's suggested #withIndexSelect:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pharo-dev