Here the implementation of Set which can include nils. Where do you see so-called 'complexity'? I had to override only 8 methods. 2009/7/3 Igor Stasenko <siguctua@gmail.com>:
2009/7/3 Andres Valloud <avalloud@smalltalk.comcastbiz.net>:
Unlike arrayed collections, hashed collections use a sentinel value for implementation purposes. Â Such collections shouldn't be allowed to contain the sentinel because doing so introduces unnecessary complexity for the vast majority of practical applications. Â It's not worth it. Â If adding nil to a set is important, then using self as the sentinel could do (at the cost of initializing the set to contain self at all slots when the instance is created, thus duplicating the nilling the VM does for you). Â But then, the set shouldn't contain itself.
I think you are mixing an object's interface with its inner implementation details. A Set can include any object in itself, without any discrimination. But its implemented in such way that it's impossible to include nil in it. So, its not worth proving that due to limitation, which comes from implementation detail, its not worth to have Sets which can include nils.
-- Best regards, Igor Stasenko AKA sig.