[squeak-dev] [Bug & design issue] Messages understood or not understood by ProtoObject

Eliot Miranda eliot.miranda at gmail.com
Fri Feb 14 21:39:33 UTC 2020


Hi Jakob,

On Fri, Feb 14, 2020 at 1:14 PM Jakob Reschke <forums.jakob at resfarm.de>
wrote:

> Am Fr., 14. Feb. 2020 um 19:42 Uhr schrieb Eliot Miranda <
> eliot.miranda at gmail.com>:
>
>> Hi Christoph,
>>
>> On Feb 14, 2020, at 9:51 AM, Thiede, Christoph <
>> Christoph.Thiede at student.hpi.uni-potsdam.de> wrote:
>>
>>
>> > There is a good solution to this.  Low-level Inspectors *should not*
>> use instVarAt: et al.  Instead they should access object intervals via “the
>> mirror protocol”, see the methods in Context, #object:instVarAt:[put:]
>> #object:at:[put:] #objectClass:
>>
>> I like and do agree to your vision for tidying up ProtoObject!
>> Maybe we could also consider some "MetaDecorator" that inherits from
>> ProtoObject and implements #class, #instVarAt: etc. for arbitrary targets?
>> This might simplify the access to the mirror protocol, and it would be a
>> bit more object-oriented:
>>
>> (MetaDecorator on: aMorph) class "--> Morph"
>> (MetaDecorator on: aProxy) class "--> Proxy"
>> (MetaDecorator on: aProxy) instVarsInclude: 'target' "--> true"
>>
>> Sounds good.
>>
>>
>> If inspectors et al would use this, my decorators might not have to carry
> the following collection of methods/copies:
>
> asExplorerString basicInspect basicSize class instVarAt: instVarAt:put:
> perform: perform:withArguments: primitiveFailed printString
> printStringLimitedTo: respondsTo: xxxClass
>
> If DataStream et al did, add the following:
> readDataFrom:size: storeDataOn:
>
> I'm not sure how to generally handle #yourself. I have this in my
> decorators as well because I don't want to undecorate when the decorator
> receives it.
>
>
typically use of the mirror protocol, at its most basic, looks like

    thisContext object: foo instVarAt: index

so #yourself is handled by ending the cascade early, and answering the
object (foo in the above).  Yes that's a tedious refactor, but
straightforward, no?
-- 
_,,,^..^,,,_
best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200214/1b7b0b7d/attachment.html>


More information about the Squeak-dev mailing list