Philosophical questions about collections

Lex Spoon lex at cc.gatech.edu
Wed Jul 4 02:58:38 UTC 2001


"Joshua 'Schwa' Gargus" <schwa at cc.gatech.edu> wrote:
> > 
> > Also, it really seems like the two collections should have the same
> > *class* -- (1 to: 4) isn't really the same as #(1 2 3 4).
> > 
> 
> I don't know about that, Lex.  What do you mean by "really the same"?  Not
> identity; we already have == for that.  Definition, please :-)  Keep in mind
> that Whatever you come up should be at least as useful as "contains the same
> elements". 
> 

No prob: "can be used in place of".  Intervals cannot be modified in
place, while arrays can.

Then again, it's worth staying in sync with #foo vs. 'foo', and in fact
those two objects are considered #= even though one is mutable and the
other is not.

Oh well, I guess I'm okay with "same species" after all.




> Here's a case that seems similar to me: should 5 = 5.0 be false because
> the numbers are of different classes?

Good example!  Overall, "same as" seem  to be a vague concept, and we'll
just have to pick for each kind of element what it means.  For numbers,
allowing floats to equal integers is fine.


Lex





More information about the Squeak-dev mailing list