<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><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="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>