<blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' class="quote dark-border-color"><div class="quote light-border-color">
<div class="quote-author" style="font-weight: bold;">Christoph Thiede wrote</div>
<div class="quote-message">
What do you think, should we copy this into the Trunk?
</div>
</div></blockquote>

Personally, I'd get good use out of <code>at:ifPresentPut:</code> and <code>at:ifPresentPut:ifAbsentPut:</code>.<br>
I seriously considered adding them as extensions in a couple of projects.<br>

<blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' class="quote dark-border-color"><div class="quote light-border-color">
<div class="quote-author" style="font-weight: bold;">Christoph Thiede wrote</div>
<div class="quote-message">
Also, I'm not sure about the order of arguments.
</div>
</div></blockquote>

The pattern other selectors in Squeak follow is <code>present</code> first, <code>absent</code> second.<br>
We should probably keep to that pattern.<br>

<blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' class="quote dark-border-color"><div class="quote light-border-color">
<div class="quote-author" style="font-weight: bold;">Tobias Pape wrote</div>
<div class="quote-message">
I find it a bit too specific for trunk.<br>
It's quite an edge case...
</div>
</div></blockquote>

FWIW I encountered this case quite a few times over the years.<br>
It's essentially always a concern when storing and updating value objects in dictionaries.<br>

<blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' class="quote dark-border-color"><div class="quote light-border-color">
<div class="quote-author" style="font-weight: bold;">Levente Uzonyi wrote</div>
<div class="quote-message">
If wanted to have a special method for that case, I would try to look up the key only once.
</div>
</div></blockquote>

+1<br>
<br>

Stephan

        
        
        
<br/><hr align="left" width="300" />
Sent from the <a href="http://forum.world.st/Squeak-Dev-f45488.html">Squeak - Dev mailing list archive</a> at Nabble.com.<br/>