Re: [Pharo-users] ifNotEmpty(Do):

2015-10-11 Thread Marcus Denker
> On 10 Oct 2015, at 18:55, Peter Uhnák wrote: > > Collection>>ifNotEmpty: comment says > > "If the block has an argument, eval with the receiver as its argument, > but it might be better to use ifNotEmptyDo: to make the code easier to > understand" > We should update the

Re: [Pharo-users] ifNotEmpty(Do):

2015-10-11 Thread Peter Uhnák
On Sun, Oct 11, 2015 at 1:11 PM, monty wrote: > Not only isn't it easier to understand, it's harder. With collections > "do:" normally means enumeration (do:, allButLastDo:, reverseDo:), but > ifNotEmptyDo: doesn't enumerate the receiver. > But in Morphic/Spec/Bloc

Re: [Pharo-users] ifNotEmpty(Do):

2015-10-10 Thread Henrik Nergaard
Look like #ifNotEmpty: is the correct choice. Collection methods select: [ :m | (m selector includesSubstring: 'if' caseSensitive: false) and: [ m selector includesSubstring: 'empty' caseSensitive: false ] ] thenCollect: [ :m

Re: [Pharo-users] ifNotEmpty(Do):

2015-10-10 Thread Yuriy Tymchuk
Yes, ifNotEmptyDo: and ifNotNilDo: are for compatibility with other Smalltalks. The rule was added to communicate this in some way. Cheers. Uko > On 10 Oct 2015, at 18:55, Peter Uhnák wrote: > > Collection>>ifNotEmpty: comment says > > "If the block has an argument, eval