<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
> <span style="font-size:12pt">Not sendTo: instead of sentTo:? ;-)</span>
<div><br>
</div>
<div>This was the first mention of #sentTo: in this thread :)</div>
<div><br>
</div>
<div>> <span style="font-size:12pt">And I suppose it is fine to ask the decorator </span><span style="font-size:12pt">programmer to implement an #undecorated method to return the inner </span><span style="font-size:12pt">object.</span></div>
<div><br>
</div>
<div>Sounds like a mirror problem again? Perfect decorators can be nested with arbitrary depth. What should be the return value of (EasterDecorator on: (ChristmasDecorator on: Object new)) undecorated?</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Jakob Reschke <forums.jakob@resfarm.de><br>
<b>Gesendet:</b> Samstag, 15. Februar 2020 16:14:54<br>
<b>An:</b> The general-purpose Squeak developers list<br>
<b>Betreff:</b> Re: [squeak-dev] [Bug & design issue] Messages understood or not understood by ProtoObject</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Not sendTo: instead of sentTo:? ;-)<br>
<br>
Agreed that solves it. And I suppose it is fine to ask the decorator<br>
programmer to implement an #undecorated method to return the inner<br>
object. If it makes sense for the particular decorator.<br>
<br>
<br>
Am Sa., 15. Feb. 2020 um 15:59 Uhr schrieb Thiede, Christoph<br>
<Christoph.Thiede@student.hpi.uni-potsdam.de>:<br>
<br>
<br>
><br>
> > Example:<br>
><br>
> ><br>
> >    anObject := (MyDecorator on: anotherObject)<br>
> >       doSomething;<br>
> >       yourself.<br>
> ><br>
> > I would like that anObject is the decorator and not anotherObject at the end.<br>
><br>
> Marcel told me the following tip for this scenario, which sounds quite interesting to me:<br>
><br>
> doesNotUnderstand: aMessage<br>
> | result |<br>
> result := aMessage sendTo: target.<br>
> ^ target == result<br>
> ifTrue: [self]<br>
> ifFalse: [result]<br>
><br>
> :-)<br>
><br>
> ________________________________<br>
> Von: Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Jakob Reschke <forums.jakob@resfarm.de><br>
> Gesendet: Samstag, 15. Februar 2020 09:28:58<br>
> An: The general-purpose Squeak developers list<br>
> Betreff: Re: [squeak-dev] [Bug & design issue] Messages understood or not understood by ProtoObject<br>
><br>
> Thanks Eliot, I understood that for the inspector use case, but my thought about #yourself was rather the following:<br>
><br>
> If I pass the decorator around and some domain code (not in Inspector or similar) uses the decorator in a cascade with yourself at the end, I do not want the result to be the undecorated object.<br>
><br>
> Example:<br>
><br>
>     anObject := (MyDecorator on: anotherObject)<br>
>        doSomething;<br>
>        yourself.<br>
><br>
> I would like that anObject is the decorator and not anotherObject at the end.<br>
><br>
> Am Fr., 14. Feb. 2020 um 22:39 Uhr schrieb Eliot Miranda <eliot.miranda@gmail.com>:<br>
>><br>
>> Hi Jakob,<br>
>><br>
>> On Fri, Feb 14, 2020 at 1:14 PM Jakob Reschke <forums.jakob@resfarm.de> wrote:<br>
>>><br>
>>> Am Fr., 14. Feb. 2020 um 19:42 Uhr schrieb Eliot Miranda <eliot.miranda@gmail.com>:<br>
>>>><br>
>>>> Hi Christoph,<br>
>>>><br>
>>>> On Feb 14, 2020, at 9:51 AM, Thiede, Christoph <Christoph.Thiede@student.hpi.uni-potsdam.de> wrote:<br>
>>>><br>
>>>><br>
>>>> > 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:<br>
>>>><br>
>>>> I like and do agree to your vision for tidying up ProtoObject!<br>
>>>> 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:<br>
>>>><br>
>>>> (MetaDecorator on: aMorph) class "--> Morph"<br>
>>>> (MetaDecorator on: aProxy) class "--> Proxy"<br>
>>>> (MetaDecorator on: aProxy) instVarsInclude: 'target' "--> true"<br>
>>>><br>
>>>> Sounds good.<br>
>>>><br>
>>>><br>
>>> If inspectors et al would use this, my decorators might not have to carry the following collection of methods/copies:<br>
>>><br>
>>> asExplorerString basicInspect basicSize class instVarAt: instVarAt:put: perform: perform:withArguments: primitiveFailed printString printStringLimitedTo: respondsTo: xxxClass<br>
>>><br>
>>> If DataStream et al did, add the following:<br>
>>> readDataFrom:size: storeDataOn:<br>
>>><br>
>>> 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.<br>
>>><br>
>><br>
>> typically use of the mirror protocol, at its most basic, looks like<br>
>><br>
>>     thisContext object: foo instVarAt: index<br>
>><br>
>> 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?<br>
>> --<br>
>> _,,,^..^,,,_<br>
>> best, Eliot<br>
>><br>
><br>
<br>
<br>
</div>
</span></font>
</body>
</html>