[Pharo-users] ifNotEmpty(Do):

Yuriy Tymchuk yuriy.tymchuk at me.com
Sat Oct 10 14:35:13 EDT 2015


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 <i.uhnak at gmail.com> 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"
> 
> yet when I do that, Code Critic complains:
> ifNotEmptyDo: should not be used as ifNotEmpty: works for blocks with arguments, too.
> 
> 
> 1) who is right? what should I use?
> 2) shouldn't one be deprecated then? (or maybe one of them is to be compatible with other smalltalks?)
> 
> Thanks,
> Peter
> 
> 





More information about the Pharo-users mailing list