Is there a good reason why ifEmpty: and ifNotEmpty: return nil rather than the receiver (as they do in Squeak) when the condition is false?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Is there a good reason why ifEmpty: and ifNotEmpty: return nil rather than the receiver (as they do in Squeak) when the condition is false?

jaayer
In squeak, if you send ifEmpty: or ifNotEmpty: to a collection and the condition being tested (emptiness or non-emptiness) is false, then the receiver (the collection) is returned rather than nil. This is more useful and more in line with how ifNil: and ifNotNil: work (which each otherwise return the receiver).

See this bug report for more information:

http://bugs.squeak.org/view.php?id=6364


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Is there a good reason why ifEmpty: and ifNotEmpty: return nil rather than the receiver (as they do in Squeak) when the condition is false?

Stéphane Ducasse
thanks for reporting
can you open a pharo bug entry else there is 80% of chance we will forget.

Stef

On Aug 9, 2010, at 10:40 PM, jaayer wrote:

> In squeak, if you send ifEmpty: or ifNotEmpty: to a collection and the condition being tested (emptiness or non-emptiness) is false, then the receiver (the collection) is returned rather than nil. This is more useful and more in line with how ifNil: and ifNotNil: work (which each otherwise return the receiver).
>
> See this bug report for more information:
>
> http://bugs.squeak.org/view.php?id=6364
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project