[Pharo-project] Set with nil
tibabenfortlapalanca at gmail.com
Fri May 20 11:58:36 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).
IMO this would be more elegant than doing myCollection asSet
asOrderedCollection add: nil; yourself, or any other way to ensure the
elements are unique and the collection includes nil.
2011/5/20 Henrik Sperre Johansen <henrik.s.johansen at veloxit.no>
> On 20.05.2011 11:36, Bernat Romagosa wrote:
>> On a dropdown menu where you can choose between 'apple' -> #apple,
>> 'orange' -> #orange or 'nothing' -> nil, for example :)
> How does a Set figure into that?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pharo-project