Set>>add: should ignore nil argument

radoslav hodnicak rh at 4096.sk
Fri Aug 13 10:38:46 UTC 2004


On Fri, 13 Aug 2004, Richard A. O'Keefe wrote:

> Note that the ANSI Smalltalk standard says that a Set may not accept
> nil elements, but it ALSO says that you CANNOT rely on it NOT accepting them.
>
[snip]
>
> Portable code shouldn't rely on implementation-specific assumptions.
> Good quality libraries should have simple descriptions with only the
> exceptions that are really essential.

I've seen your arguments already when I searched for previous discussions
on this subject. You are probably right, except, what you say has no
practical consequences. Nobody's going to rewrite the collection libraries
in all smalltalks to be correct, good and non-perverse. It is as it is.
And I prefer having not correct, but compatible implementation to having
not correct, but incompatible implementation.

rado




More information about the Squeak-dev mailing list