On 26.11.2008 05:32, Igor Stasenko wrote:
Of course i know it. Just a small(talk) correction: classes are objects as well and having state as well.
From "The Early History of Smalltalk" by Alan Kay
- Everything is an object
- Objects communicate by sending and receiving messages (in terms of objects)
- Objects has their own memory (in terms of objects)
- Every object is an instance of class (which must be an object)
- The class holds the shared behavior for its instances (in the form
of objects in a program list) 6. To eval a program list, control is passed to the first object and the remainder is treated as its message
so, where in these statements you find anything about inheritance, or something where it says that subclass(es) should have any assumptions about the ways how superclass is storing its instances in memory, and therefore a subclass allowed to directly manipulate the object's state without consulting with superclass?
I'm afraid Alan wasn't as precise as he should have been here. In a Squeak image, everything *IS REPRESENTED* by an object. I represent a cat by an object, but that doesn't magically transform the purring cat into a Squeak object. I *REPRESENT* a class by an object, but it is confusing the issue to remove the distinction between the essence of a class and its representation as an object. Many a discussion has gone astray through this confusion. (Have you ever heard anyone say "class A send a message to class B" when they mean "an instance of class A send a message to an instance of class B"? )
--Trygve