[Pharo-users] ifNotEmpty(Do):

Marcus Denker marcus.denker at inria.fr
Sun Oct 11 05:29:58 EDT 2015

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

We should update the comment. I think the comment is wrong: there is nothing more
easier to understand with # ifNotEmptyDo: vs. # ifNotEmpty.

> 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 smalltalk?)

We did not deprecated as this is used a lot in old code… we should move it to a compatibility package.


More information about the Pharo-users mailing list