[squeak-dev] How to become immediate objects? :-)

Chris Muller asqueaker at gmail.com
Tue Apr 14 21:27:29 UTC 2020


Hi Eliot,


> Right.  A couple of questions are
> 1. what the f**k are become: becomeForward: becomeForward:copyHash: et al
> doing in ProtoObject?  (IMO, they should be in Object and have no business
> being in ProtoObject whatsoever).
>

For Proxy's.  They don't typically inherit from Object, but must be able to
become their normal object upon receiving a message it
#doesNotUnderstand:.  Maybe you're implying those programs should be using
the mirror primitives, but those weren't always available, so hopefully
that at least answers your question.

2. whether becomeForward: should do copyHash: true by default.  This seems
> wrong to me, and implementing is as copyHash: false makes more sense.  But
> I'm wondering if there are important use cases.
>

Yes, changing the identityHash without changing the identity is basically
"wrong", and even dangerous if it's a system Symbol used as keys in
IdentityDictionary's like Environments, etc.

   Object new becomeForward: #size   "do it = lock up your image"

 - Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200414/b101566f/attachment.html>


More information about the Squeak-dev mailing list