[squeak-dev] Re: Letting Set contain nils?
siguctua at gmail.com
Sun Aug 10 15:49:18 UTC 2008
2008/8/10 Hans-Martin Mosner <hmm at heeg.de>:
> Igor Stasenko schrieb:
>> My point is to make sets which can contain ANY object without discrimination.
> this topic has probably already been beaten to death,
it is certain that your post putting last nail to its coffin, because
what you proposing is already described early in this topic :)
> but here's another
> Since sets need to mark unused slots and use nil for that purpose, they
> cannot contain nil directly.
> But it would be simple to just add an instance variable 'includesNil'
> which gets set to true when nil is added, and which would be used for
> enumeration and inclusion testing.
> Regarding the fear that making sets accept nil would break existing
> code: it would not, but it would probably encourage users to write code
> which won't work on other Smalltalk systems where this is not supported,
> so in the interest of easier code interchange I'd leave it out, even
> though it would make some sense in certain situations.
Igor Stasenko AKA sig.
More information about the Squeak-dev