Hi! Since a year ago, we have this issue: http://code.google.com/p/pharo/issues/detail?id=1907 There were 2 solutions proposed, and the 2 were developed by different people. But for some reason it was not integrated and continuously postponed. So, my question is: Do we want Sets accepting nil? If we don't, the issue is invalid. If we do, can someone review the code proposed? Thanks! Guille
On 20 May 2011 04:13, Guillermo Polito <guillermopolito@gmail.com> wrote:
Hi!
Since a year ago, we have this issue:
http://code.google.com/p/pharo/issues/detail?id=1907
There were 2 solutions proposed, and the 2 were developed by different people. But for some reason it was not integrated and continuously postponed.
So, my question is: Do we want Sets accepting nil? If we don't, the issue is invalid. If we do, can someone review the code proposed?
Its not invalid. Stef reminds me about it from time to time. And actually we wanted to sit and review and integrate it but it always something else needs our attention.
Thanks! Guille
-- Best regards, Igor Stasenko AKA sig.
If we understand nil as the empty set (like some other languages do), then Set with: nil is not any different than Set with: Set new. 2011/5/20 Igor Stasenko <siguctua@gmail.com>
On 20 May 2011 04:13, Guillermo Polito <guillermopolito@gmail.com> wrote:
Hi!
Since a year ago, we have this issue:
http://code.google.com/p/pharo/issues/detail?id=1907
There were 2 solutions proposed, and the 2 were developed by different people. But for some reason it was not integrated and continuously postponed.
So, my question is: Do we want Sets accepting nil? If we don't, the issue is invalid. If we do, can someone review the code proposed?
Its not invalid. Stef reminds me about it from time to time. And actually we wanted to sit and review and integrate it but it always something else needs our attention.
Thanks! Guille
-- Best regards, Igor Stasenko AKA sig.
On May 20, 2011, at 9:40 AM, Bernat Romagosa wrote:
If we understand nil as the empty set (like some other languages do),
??? No nil is not the empty set this is the undefined object. Stef
then Set with: nil is not any different than Set with: Set new.
2011/5/20 Igor Stasenko <siguctua@gmail.com> On 20 May 2011 04:13, Guillermo Polito <guillermopolito@gmail.com> wrote:
Hi!
Since a year ago, we have this issue:
http://code.google.com/p/pharo/issues/detail?id=1907
There were 2 solutions proposed, and the 2 were developed by different people. But for some reason it was not integrated and continuously postponed.
So, my question is: Do we want Sets accepting nil? If we don't, the issue is invalid. If we do, can someone review the code proposed?
Its not invalid. Stef reminds me about it from time to time. And actually we wanted to sit and review and integrate it but it always something else needs our attention.
Thanks! Guille
-- Best regards, Igor Stasenko AKA sig.
please please please I want that! I want to be able to do: aSet add: 'mariano'; add: nil; add: 'guille'; add: nil. aSet size -> 3 aSet contains: nil -> true aSet remove: nil. aSet contains: nil -> false On Fri, May 20, 2011 at 9:53 AM, Stéphane Ducasse <stephane.ducasse@inria.fr
wrote:
On May 20, 2011, at 9:40 AM, Bernat Romagosa wrote:
If we understand nil as the empty set (like some other languages do),
??? No nil is not the empty set this is the undefined object.
Stef
then Set with: nil is not any different than Set with: Set new.
2011/5/20 Igor Stasenko <siguctua@gmail.com> On 20 May 2011 04:13, Guillermo Polito <guillermopolito@gmail.com> wrote:
Hi!
Since a year ago, we have this issue:
http://code.google.com/p/pharo/issues/detail?id=1907
There were 2 solutions proposed, and the 2 were developed by different people. But for some reason it was not integrated and continuously postponed.
So, my question is: Do we want Sets accepting nil? If we don't, the issue is invalid. If we do, can someone review the code proposed?
Its not invalid. Stef reminds me about it from time to time. And actually we wanted to sit and review and integrate it but it always something else needs our attention.
Thanks! Guille
-- Best regards, Igor Stasenko AKA sig.
-- Mariano http://marianopeck.wordpress.com
On 20.05.2011 11:14, Mariano Martinez Peck wrote:
please please please I want that!
I want to be able to do:
aSet add: 'mariano'; add: nil; add: 'guille'; add: nil.
aSet size -> 3
aSet contains: nil -> true
aSet remove: nil.
aSet contains: nil -> false It's not like I'm principaly against it, but... why? Other than treating all objects equally, I mean?
I honestly can't come up with a single case where I'd want to put nil in a Set on purpose. Cheers, Henry
On a dropdown menu where you can choose between 'apple' -> #apple, 'orange' -> #orange or 'nothing' -> nil, for example :) 2011/5/20 Henrik Sperre Johansen <henrik.s.johansen@veloxit.no>
On 20.05.2011 11:14, Mariano Martinez Peck wrote:
please please please I want that!
I want to be able to do:
aSet add: 'mariano'; add: nil; add: 'guille'; add: nil.
aSet size -> 3
aSet contains: nil -> true
aSet remove: nil.
aSet contains: nil -> false
It's not like I'm principaly against it, but... why? Other than treating all objects equally, I mean?
I honestly can't come up with a single case where I'd want to put nil in a Set on purpose.
Cheers, Henry
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@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 :)
Huh? How does a Set figure into that?
Cheers, Henry
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
Why this defensive approach to code that adds duplicate entries to a menu? Why not avoid the duplicated entries from being added to begin with? On 5/20/11 2:58 , Bernat Romagosa wrote:
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@veloxit.no <mailto:henrik.s.johansen@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 :)
Huh? How does a Set figure into that?
Cheers, Henry
participants (8)
-
Andres Valloud -
Bernat Romagosa -
Guillermo Polito -
Henrik Sperre Johansen -
Igor Stasenko -
Mariano Martinez Peck -
Nick Ager -
Stéphane Ducasse