Not just more readable. They can also be more efficient. Look at #select:thenCollect: in OrderedCollection: select: selectBlock thenCollect: collectBlock " Optimized version Collection>>#select:thenCollect: "
| newCollection element | newCollection := self copyEmpty. firstIndex to: lastIndex do: [ :index | element := array at: index. (selectBlock value: element) ifTrue: [ newCollection addLast: (collectBlock value: element) ]]. ^ newCollection It only uses one temp collection, where a #select: followed by a separate #collect: would need two. ___ montyos.wordpress.com > Sent: Thursday, June 07, 2018 at 8:20 AM > From: "Tim Mackinnon" <tim@testit.works> > To: "Pharo Users Newsgroup" <pharo-users@lists.pharo.org> > Subject: [Pharo-users] Why do #select:thenXxx methods not return their result > > Hi - are the methods like #select:thenCollect: frowned upon? > > They seem quite readable , however in using them I’ve noticed that unlike the > core methods they done return the result of evaluation (they are missing a > ^). This is a shame, but possibly an oversight? > > Tim > > Sent from my iPhone > >