[Pharo-project] Set with nil

Nick Ager nick.ager at gmail.com
Fri May 20 12:08:23 CEST 2011

> You may want the collection from which you build a menu to be a Set because
> you don't want to have repeated entries in a menu, and you'd want nil to be
> there if your field can be empty. When the menu items are automatically
> generated, it'd be nice to be able to do Whatever buildMenuFrom:
> (myCollection asSet add: nil; yourself).

In this particular case you could model your "do nothing" menu option using
a special-case pattern - http://martinfowler.com/eaaCatalog/specialCase.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gforge.inria.fr/pipermail/pharo-project/attachments/20110520/956dab87/attachment.htm>

More information about the Pharo-project mailing list