Set>>add:

Benoit St-Jean bstjean at yahoo.com
Wed Nov 13 15:33:45 UTC 2002


--- "Richard A. O'Keefe" <ok at cs.otago.ac.nz> wrote:
> Nevin Pratt <nevin at smalltalkpro.com> wrote:
> 	VisualWorks for this case just returns nil, and
> otherwise does nothing.
> 	Squeak throws an exception.
> 	
> There are only two reasonable things that
> 
>     s := Set new.
>     s add: nil.
>     s size
> 
> can do:  return 1 or produce some sort of error
> notification.
> In Squeak 3.0 and 3.2 I get an error notification
> saying
>     "Sets cannot meaningfully contain nil as an
> element"
> which says it all, really.  It's about as good an
> outcome as one could
> hope for, given the rather odd restriction that nil
> CAN be an element of
> an Array but CAN'T be an element of a Set even
> though it supports all the
> methods that a Set element otherwise needs...
> 
> 	GLORP appears to depend upon the VisualWorks
> behavior.  Since GLORP has 
> 	been ported to VA and Dolphin, I'm guessing that
> they also have VW's 
> 	behavior.  Thus, Squeak appears to be the odd-man
> out.

Just to compare,

VA answers <nil> just as VW
Smalltalk Express answers <nil> just as VW

=====
-------------------------
Benoit St-Jean
bstjean at yahoo.com
Yahoo! Messenger: bstjean
http://cactus.swiki.net
-------------------------

__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2



More information about the Squeak-dev mailing list