<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
                                        > <span style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px">Might be less efficient (I haven't measured it) but provides better readability. :-)</span><div><span style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px"><br></span></div><div><span style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px">Mine is actually faster than yours. ;o) </span></div><div><span style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px"><br></span></div><div><span style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px">> </span><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">Imagine a morph that changes its fill style regularly while stepping, and that should be displayed with a different border style while a dialog window is open.</span></div><div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px"><br></span></div><div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">You want to optimize for the functional style around "DialogWindow >> getUserResponse"? I wouldn't do that. Most of Morphic is state-based. Maybe we find a better way for showing dialogs as well. It is tricky to support [CMD]+[Dot] along with nested UI loops.</span></div><div><span style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px"><br></span></div><div>Best,</div><div>Marcel</div><div class="mb_sig"></div>
                                        <blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
                        <p style="color: #AAAAAA; margin-top: 10px;">Am 08.12.2020 14:19:34 schrieb Thiede, Christoph <christoph.thiede@student.hpi.uni-potsdam.de>:</p><div style="font-family:Arial,Helvetica,sans-serif">

<div id="divtagdefaultwrapper" style="font-size: 12pt;color: #000000;font-family: Calibri,Helvetica,sans-serif" dir="ltr">
<p>Hi Marcel,</p>
<p><br>
</p>
<p>> <span>Preferences does not expose the dictionary. It is rather an implementation detail.</span></p>
<p><span><br>
</span></p>
<p><span>Yes, but #<span>setPreference:toValue:during: *could* reuse #at:put:during: instead of reinventing this - though small - wheel. :-)</span></span></p>
<p><span><span><br>
</span></span></p>
<p><span><span>> <span>there are implementations of #at:put: where a "nil" value deletes the key.</span></span></span></p>
<p><span><span><span><br>
</span></span></span></p>
<p><span><span><span>Isn't this a completely domain-specific design decision? I think we should look at this at a different level of abstraction.</span></span></span></p>
<p><span><span><span><br>
</span></span></span></p>
<p>> <span>I would rather not support modifying the dictionary during "aBlock". Similar to #do: etc. in a collection.</span></p>
<p><span><br>
</span></p>
<p><span>But the semantics of an execution-around method do not need to be timeless as mentioned earlier. Imagine a morph that changes its fill style regularly while stepping, and that should be displayed with a different border style while a dialog window
 is open. In this example, forbidding the manipulation of extensions during aBlock would rule out the use of #at:put:during: ...</span></p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt;color: rgb(0, 0, 0);font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols">
<div name="divtagdefaultwrapper" style="font-family: Calibri,Arial,Helvetica,sans-serif;font-size: ;margin: 0">
<div>
<div class="_rp_T4" id="Item.MessagePartBody">
<div class="_rp_U4 ms-font-weight-regular ms-font-color-neutralDark rpHighlightAllClass rpHighlightBodyClass" id="Item.MessageUniqueBody" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<div dir="ltr">
<div id="divtagdefaultwrapper"><span style="font-family: Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols">
<div id="Signature">
<div style="margin:0px"><span style="">
<div><font size="3" color="black"><span style="font-size: 12pt"><a href="http://www.hpi.de/" target="_blank" rel="noopener noreferrer" id="LPNoLP"><font size="2"><span id="LPlnk909538"><font color="#757B80"></font></span></font></a></span></font></div>
</span></div>
</div>
</span></div>
</div>
</div>
</div>
<div class="_rp_T4" id="Item.MessagePartBody"><br>
</div>
<div class="_rp_T4" id="Item.MessagePartBody">> <span style="font-size: 12pt">What about this implementation? Seems to so "low level":</span>
<div><br>
</div>
<div>Might be less efficient (I haven't measured it) but provides better readability. :-)</div>
<div><br>
</div>
<div>Best,</div>
<div>Christoph</div>
</div>
</div>
<div><span style="font-size: 10pt;color: #808080"></span></div>
</div>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><span style="font-family: Calibri, sans-serif;color: #000000"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel<br>
<b>Gesendet:</b> Dienstag, 8. Dezember 2020 13:34:33<br>
<b>An:</b> squeak-dev<br>
<b>Betreff:</b> Re: [squeak-dev] The Inbox: Collections-ct.922.mcz</span>
<div> </div>
</div>
<div>
<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
Hmm... Preferences does not expose the dictionary. It is rather an implementation detail. See:
<div><br>
</div>
<div>Preferences class >> #setPreference:toValue:<br>
</div>
<div>Preferences class >> #setPreference:toValue:during:</div>
<div><br>
</div>
<div>Hmm... there are implementations of #at:put: where a "nil" value deletes the key. See:</div>
<div><br>
</div>
<div>Morph >> #setProperty:toValue:</div>
<div><br>
</div>
<div>Hmm... I am not sure about the returned value. Shouldn't it be the object? Should it the block's last result? Depends on the purpose, I suppose.</div>
<div><br>
</div>
<div>Hmm... I would rather not support modifying the dictionary during "aBlock". Similar to #do: etc. in a collection.</div>
<div><br>
</div>
<div>What about this implementation? Seems to so "low level":</div>
<div><br>
</div>
<div>
<div><span style="font-size: 13.3333px"><span style="white-space:pre"></span>| hasKey oldValue |</span></div>
<div><span style="font-size: 13.3333px"><span style="white-space:pre"></span>self at: key ifPresent: [:v | oldValue := v. hasKey := true].</span></div>
<div><span style="font-size: 13.3333px"><span style="white-space:pre"></span>self at: key put: anObject.</span></div>
<div><span style="font-size: 13.3333px"><span style="white-space:pre"></span>^ aBlock ensure: [</span></div>
<div><span style="font-size: 13.3333px"><span style="white-space:pre"></span>hasKey == true</span></div>
<div><span style="font-size: 13.3333px"><span style="white-space:pre"></span>ifTrue: [self at: key put: oldValue]</span></div>
<div><span style="font-size: 13.3333px"><span style="white-space:pre"></span>ifFalse: [self removeKey: key]]</span></div>
</div>
<div><br>
</div>
<div>Best,</div>
<div>Marcel</div>
<div class="mb_sig"></div>
<blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
<p style="color: #AAAAAA; margin-top: 10px;">Am 07.12.2020 19:14:30 schrieb Thiede, Christoph <christoph.thiede@student.hpi.uni-potsdam.de>:</p>
<div style="font-family:Arial,Helvetica,sans-serif">
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size: 12pt;color: #000000;font-family: Calibri,Helvetica,sans-serif">
<p>I wanted to provide it as a general functionality - you could use this in many situations, for example for adding a process variable temporarily, changing a morphic extension temporarily, or maybe even to adjust a preference temporarily ... Where temporary,
 just for example, might mean for the duration of a test execution (which, of course, might be debugged, so is not necessarily run as an atomic operation). In all these situations, the entire system needs to be kept running without introducing any unintended
 sandbox effects. :-)</p>
<div id="x_Signature">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size: 12pt;color: rgb(0,0,0);font-family: Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div name="x_divtagdefaultwrapper" style="font-family: Calibri,Arial,Helvetica,sans-serif;font-size: ;margin: 0">
<div>
<div class="x__rp_T4" id="x_Item.MessagePartBody">
<div class="x__rp_U4 x_ms-font-weight-regular x_ms-font-color-neutralDark x_rpHighlightAllClass x_rpHighlightBodyClass" id="x_Item.MessageUniqueBody" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<div dir="ltr">
<div id="x_divtagdefaultwrapper"><span style="font-family: Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols">
<div id="x_Signature">
<div style="margin:0px"><span style="">
<div><span style="font-size: 12pt;color: black"><span style="font-size: 12pt"><a href="http://www.hpi.de/" target="_blank" rel="noopener noreferrer" id="LPNoLP"><span style="font-size: 10pt"><span id="LPlnk909538"><font color="#757B80"></font></span></span></a></span></span></div>
</span></div>
</div>
</span></div>
</div>
</div>
</div>
<div class="x__rp_T4" id="x_Item.MessagePartBody"><br>
</div>
<div class="x__rp_T4" id="x_Item.MessagePartBody">Best,</div>
<div class="x__rp_T4" id="x_Item.MessagePartBody">Christoph</div>
</div>
<div><span style="font-size: 10pt;color: #808080"></span></div>
</div>
</div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><span style="font-family: Calibri, sans-serif;color: #000000"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von tim Rowledge <tim@rowledge.org><br>
<b>Gesendet:</b> Montag, 7. Dezember 2020 19:10:11<br>
<b>An:</b> The general-purpose Squeak developers list<br>
<b>Betreff:</b> Re: [squeak-dev] The Inbox: Collections-ct.922.mcz</span>
<div> </div>
</div>
</div>
<span style="font-size: 10pt"><span style="font-size: 10pt">
<div class="PlainText"><br>
<br>
> On 2020-12-07, at 10:05 AM, Thiede, Christoph <Christoph.Thiede@student.hpi.uni-potsdam.de> wrote:<br>
> <br>
> IIUYC this would make it impossible to keep other changes to the dictionary after leaving the execution around method?<br>
Absolutely. Depends on what your deeper purpose is. <br>
<br>
<br>
tim<br>
--<br>
tim Rowledge; tim@rowledge.org; <a href="http://www.rowledge.org/tim">http://www.rowledge.org/tim</a><br>
Strange OpCodes: LAG: Load and Garble<br>
<br>
<br>
<br>
</div>
</span></span></div>
</blockquote>
</div>
</div>
</div></blockquote></div>