> 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
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
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
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