<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2654.45">
<TITLE>RE: [BUG]Collection>>removeAll:</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Hello.</FONT>
</P>
<P><FONT SIZE=2>> x\x and xUx were relevant to what the final state of the receiver should be; the point is that a state equivalent to those should be reached.</FONT></P>
<P><FONT SIZE=2>When you write x in x\x or xUx, you don't refer to the actual set, you refer to a definition. You can refer to a definition because you wrote something like</FONT></P>
<P> <FONT SIZE=2>x = {e | e has some property}</FONT>
<BR> <FONT SIZE=2>y = {e1, ..., en}</FONT>
</P>
<P><FONT SIZE=2>In fact, the "result" of expressions like x\y is not a set. It is a definition, because that's how \ was defined:</FONT>
</P>
<P> <FONT SIZE=2>x\y = {e | e in x AND e not in y}</FONT>
</P>
<P><FONT SIZE=2>Named "sets" are just shorthands for their definitions, in the same way in which x\y and xUy are shorthands for the definitions they imply.</FONT></P>
<P><FONT SIZE=2>In the particular case x\x, we obtain a definition equivalent to that of the empty set. We don't get the empty set, or remove elements from x, or anything like that.</FONT></P>
<P><FONT SIZE=2>There's no math set operation that mutates sets --- of course, because set theory is about the controlled manufacture of definitions. In fact, you can have set theory by playing boolean algebra with the definitions of sets. In some sense, "sets" themselves don't even need to exist for you to have a set theory because a set is just the collection of all objects which satisfy the definition --- which you may or may not be interested in.</FONT></P>
<P><FONT SIZE=2>Smalltalk's collections, on the other hand, are not implemented around definitions: they're the actual elements. That's why x\x makes sense in set theory and x removeAll: x doesn't make sense in Smalltalk.</FONT></P>
<P><FONT SIZE=2>Note how there are none of these issues with non-mutating messages (circularities excluded).</FONT>
</P>
<P><FONT SIZE=2>A definition of an object *IS NOT* the object.</FONT>
</P>
<P><FONT SIZE=2>Andres.</FONT>
</P>
</BODY>
</HTML>