[squeak-dev] Re: Newbie Question (about OOPs, maybe) (sorry)

Bert Freudenberg bert at freudenbergs.de
Sat Aug 22 15:26:02 UTC 2009


On 22.08.2009, at 12:39, Trygve Reenskaug wrote:

> Object>>asOop
>     "Primitive. Answer a SmallInteger whose value is half of the  
> receiver's
>     object pointer (interpreting object pointers as 16-bit signed  
> quantities)..."
>
> ProtoObject>>identityHash
>     "Answer a SmallInteger whose value is related to the receiver's  
> identity..."
> This is pretty vague, but the term 'Hash' indicates that many  
> objects can share the same value. So it is clearly cannot be used as  
> the objectID.
>
> The Morph>>printOn: implementation is less than ideal because it  
> should apply to all objects, not only Morphs. Also, it should use  
> 'asOop' rather than 'identityHash' to let us hope for uniqueness.

You might have overlooked that both these methods are identical.

> In short:
> Smalltalk claims to be object oriented and I regard it as a serious  
> flaw that the object ID is not explicitly visible.

What if there simply *is* no object ID?

> We probably need a 64-bit VM to represent it properly, e.g., using  
> the standardized definition of OID, but a value that is guaranteed  
> to be unique within the current set of objects would be acceptable..

What is the "standardized definition of OID"?

> I regard it as a bug that Object>>printOn: does not present some  
> kind of object ID.

Has never bothered me.

- Bert -


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20090822/1bf75fd0/attachment.htm


More information about the Squeak-dev mailing list