At 7:29 Uhr -0800 30.03.1999, Dan Ingalls wrote:
123 size no longer responds with 0. nil size no longer responds with 0.
Why ?
I found the latter extremely handy in cases where one could get back either a (possibly empty) collection or nil.
I agree with the why question. Many collections are lazy initialized and that makes nil size really useful. Moreover, size is a basic message; one expects that any object can nicely respond to it.
Leandro
At 7:29 Uhr -0800 30.03.1999, Dan Ingalls wrote:
123 size no longer responds with 0. nil size no longer responds with 0.
That seems like a radical change in the semantics. Size seems to be everywhere defined to be the number of indexable variables in the receiver; so 0 seems like that right answer for objects that have no indexable variables.
squeak-dev@lists.squeakfoundation.org