[squeak-dev] Re: Instance variable access in superclasses.

Trygve Reenskaug trygver at ifi.uio.no
Wed Nov 26 07:40:11 UTC 2008



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
>
> 1. Everything is an object
> 2. Objects communicate by sending and receiving messages (in terms of objects)
> 3. Objects has their own memory (in terms of objects)
> ----
> 4. Every object is an instance of class (which must be an object)
> 5. 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
-- 

Trygve Reenskaug       mailto: trygver at ifi.uio.no

Morgedalsvn. 5A         http://heim.ifi.uio.no/~trygver

N-0378 Oslo               Tel: (+47) 22 49 57 27

Norway

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20081126/8af130b4/attachment.htm


More information about the Squeak-dev mailing list