Set>>add: should ignore nil argument

Kamil Kukura kamk at volny.cz
Thu Aug 12 10:22:19 UTC 2004


> On Thu, 12 Aug 2004, Marcin Tustin wrote:
>>    What if I *want* to store a nil value in a set

radoslav hodnicak wrote:
> Then you have to find a smalltalk dialect that allows it. In other words,
> check the current Squeak implementation of this method before you start
> trolling.

I peeked into ANSI draft standard 
<http://minnow.cc.gatech.edu/squeak/uploads/172/standard_v1_9-indexed.pdf> 
and in section 5.7.7 describing <Set> protocol it says:

"Conformant protocols may place restrictions on the type of objects that 
are valid elements. Unless otherwise specified, any object is acceptable."

However, further on message "add: newElement" is says:

"The results are undefined if newElement is nil."

Well, I'm not any wiser from this, but generally (nil == nil copy) is 
true, so if that is not the problem...

-- 
Kamil Kukura



More information about the Squeak-dev mailing list