Set>>add: should ignore nil argument

Roel Wuyts Roel.Wuyts at ulb.ac.be
Fri Aug 13 07:55:03 UTC 2004


Well, let me rephrase then (you have to imagine the Nooooo fading away 
near the end, like in the mountains):

Noooooooo !!! Do not start to use exceptions for this kind of control
flow!!! It is not an exception. Making it an exception will get *us*
into all kinds of trouble...

:-)

I don't have the habit of adding nil to sets (or other things), as it 
is undefined (after all). So I didn't notice it :-) But I consider it 
really ugly to throw this exception. The fact that nil is used as a 
sentinel object is a real implementation detail, and should not become 
visible like this. I liked Lex's solution, BTW, but I don't have the 
time to do it.

On 13 Aug 2004, at 09:11, Marcin Tustin wrote:

> On Fri, Aug 13, 2004 at 09:02:32AM +0200, Roel Wuyts wrote:
>> Noooooooo !!! Do not start to use exceptions for this kind of control
>> flow!!! It is not an exception. Making it an exception will get you
>> into all kinds of trouble...
>
>     Have you seen what happens when you add nil to a Set in squeak?
> Unless I'm mistaken (which is quite possible, as I'm a novice), an
> exception is raised
>
>
Roel Wuyts                                                              
   DeComp
roel.wuyts at ulb.ac.be                               Université Libre de 
Bruxelles
http://homepages.ulb.ac.be/~rowuyts/                                    
Belgique
Board Member of the European Smalltalk User Group: www.esug.org




More information about the Squeak-dev mailing list