Where does WeakMessageSend get new: from?
Brian Brown
rbb at techgame.net
Mon Feb 16 22:15:35 UTC 2004
On Feb 16, 2004, at 1:44 PM, Ned Konz wrote:
> On Monday 16 February 2004 11:32 am, Brian Brown wrote:
>
>> When looking at WeakMessageSend>>new, it calls self new: 1 and
>> responds
>> to at:put: but new: isn't in it's protocol.
>>
>> Then I saw that the class definition is:
>> Object weakSubClass: #WeakMessageSend
>>
>> um, what is that? A primitive? How could I investigate this?
>
> There are several kinds of objects in the system.
>
> Generally, an object can have:
>
> * 0 or more named instance variables containing (non-weak) object
> references
>
> followed by:
>
> * 0 or more numbered slots, all containing the same sort of thing. You
> use
> #new: to get the number of slots that you want, and use #at: and
> #at:put: to
> access the slots.
>
Ok, that makes sense.
> The choices for the contents of slots are:
>
> - object references (isVariable & isPointers & isWeak not)
> - weak object references (isVariable & isWeak & isPointers)
> - bytes (isBytes & isVariable)
> - words (32-bit non-object-reference values) (isVariable & isWords &
> isPointers not)
>
Alright. (one thing going against me is that I was thinking that the
Class definition was somehow special, and not a message send ... I
never even thought of looking on Class for creation methods)
> The corresponding creation methods in Class are:
>
> subclass:instanceVariableNames:classVariableNames:poolDictionaries:
> category:
> (just named object references) (most of the classes in the system are
> of this
> sort)
Thanks for explaining this!
Brian
More information about the Squeak-dev
mailing list
|