On Oct 6, 2008, at 3:47 AM, David Pennell wrote:

Stef,

I would expect to see another implementation of ifEmptyOrNil on UndefinedObject that returns true. I've seen it used productively for defensive coding in frameworks, where you may get nil instead of an empty collection passed to you.

Hi david

Good suggestion. I learned something.

UndefinedObject>>isEmptyOrNil
"Answer whether the receiver contains any elements, or is nil. Useful in numerous situations where one wishes the same reaction to an empty collection or to nil"
        ^ true

I still find that somehow ugly. Fixing the cause not the problem.

Stef

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

Reply via email to