<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<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">
<p>Hi Marcel,</p>
<p><br>
</p>
<p>do I understand correctly that your point is to reach polymorphy with other types of dictionaries? Well, that changes things, of course. :-)</p>
<p>(Then again, which client can expect a regular dictionary not to answer KeyNotFound for arbitrary items that have not been added before? )</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"><br>
</div>
<div class="x__rp_T4" id="x_Item.MessagePartBody">I think the use case of mapping values to collections is not being represented in a sufficient way in the current Collections API, thus I find your proposal very interesting. For reference, .NET has
<a href="https://docs.microsoft.com/de-de/dotnet/api/system.linq.igrouping-2?view=net-5.0" class="x_OWAAutoLink">
IGrouping`2</a> which appears as a similar concept to me. I don't want to block your proposal in any way (not that I would be in that position at all :D), I'm just curious about our plans on subclassing Dictionary in general.</div>
<div class="x__rp_T4" id="x_Item.MessagePartBody">Just for interest, do you maybe have some other concrete use cases for a CollectionsDictionary in Squeak? :-)
<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"><font face="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"><font style="font-family:Calibri,Arial,Helvetica,sans-serif,serif,EmojiFont"></font></div>
</div>
</font></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><font size="2" color="#808080"></font></div>
</div>
</div>
</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 Tony Garnock-Jones <tonyg@leastfixedpoint.com><br>
<b>Gesendet:</b> Freitag, 26. März 2021 20:26:31<br>
<b>An:</b> The general-purpose Squeak developers list; Taeumel, Marcel<br>
<b>Betreff:</b> Re: [squeak-dev] The Inbox: Collections-mt.932.mcz</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">What about something like:<br>
<br>
   collection: aClass at: key do: aBlock<br>
     | coll result |<br>
     coll := self at: key ifAbsentPut: [aClass new].<br>
     result := aBlock value: coll.<br>
     coll ifEmpty: [self removeKey: key].<br>
     ^ result<br>
<br>
... perhaps with `ensure:` to do the removal?<br>
<br>
Then:<br>
<br>
   myDictOfSets collection: Set at: #key1 do: [:s | s add: 123].<br>
<br>
<br>
On 3/26/21 8:17 PM, Marcel Taeumel wrote:<br>
> ...<br>
<br>
</div>
</span></font>
</body>
</html>