<div dir="ltr">Could someone move this to trunk? Just fixed the comment (since we don&#39;t have a NewDictionary in trunk currently).<div><br></div><div>I do have a mostly unrelated question.  This method (newFrom:) checks to see if there is a duplicate key that in the source when making the new Dictionary, and fails if there is. But #newFromPairs: doesn&#39;t check - just happily writes over the previous value.</div><div><br></div><div>Dictionary newFromPairs: {&#39;Red&#39; . Color red . &#39;Blue&#39; . Color blue . &#39;Green&#39; . Color green. &#39;Blue&#39; . Color green. }.<br></div><div><br></div><div>Is there a good, valid reason they are consistent?</div><div><br></div><div>-cbc</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 13, 2016 at 3:29 PM,  <span dir="ltr">&lt;<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">A new version of Collections was added to project The Inbox:<br>
<a href="http://source.squeak.org/inbox/Collections-cbc.689.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/inbox/Collections-cbc.689.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Collections-cbc.689<br>
Author: cbc<br>
Time: 13 April 2016, 3:28:58.221861 pm<br>
UUID: 84ae8fa7-91ee-4f47-8bdf-eadcac286a1e<br>
Ancestors: Collections-mt.688<br>
<br>
Fix comment in Dictioanry class&gt;&gt;newFrom: so that the examples actually work.<br>
<br>
=============== Diff against Collections-mt.688 ===============<br>
<br>
Item was changed:<br>
  ----- Method: Dictionary class&gt;&gt;newFrom: (in category &#39;instance creation&#39;) -----<br>
  newFrom: aDict<br>
        &quot;Answer an instance of me containing the same associations as aDict.<br>
         Error if any key appears twice.&quot;<br>
        | newDictionary |<br>
        newDictionary := self new: aDict size.<br>
        aDict associationsDo:<br>
                [:x |<br>
                (newDictionary includesKey: x key)<br>
                        ifTrue: [self error: &#39;Duplicate key: &#39;, x key printString]<br>
                        ifFalse: [newDictionary add: x copy]].<br>
        ^ newDictionary<br>
<br>
+ &quot;     Dictionary newFrom: {1-&gt;#a. 2-&gt;#b. 3-&gt;#c}<br>
+       {1-&gt;#a. 2-&gt;#b. 3-&gt;#c} as: Dictionary<br>
+       Dictionary newFrom: {1-&gt;#a. 2-&gt;#b. 1-&gt;#c}<br>
+       {1-&gt;#a. 2-&gt;#b. 1-&gt;#c} as: Dictionary<br>
- &quot;     NewDictionary newFrom: {1-&gt;#a. 2-&gt;#b. 3-&gt;#c}<br>
-       {1-&gt;#a. 2-&gt;#b. 3-&gt;#c} as: NewDictionary<br>
-       NewDictionary newFrom: {1-&gt;#a. 2-&gt;#b. 1-&gt;#c}<br>
-       {1-&gt;#a. 2-&gt;#b. 1-&gt;#c} as: NewDictionary<br>
  &quot;!<br>
<br>
<br>
</blockquote></div><br></div>