[squeak-dev] The Inbox: Collections-ct.860.mcz

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Sun Nov 17 16:36:13 UTC 2019

Thank you for the review! This was actually intended, or what would expect the following to do?

Dictionary fromKeys: 'wasda' values: '84265'

Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Jakob Reschke <forums.jakob at resfarm.de>
Gesendet: Sonntag, 17. November 2019 17:24:25
An: squeak-dev at lists.squeakfoundation.org
Betreff: Re: [squeak-dev] The Inbox: Collections-ct.860.mcz

Is there a strong indication to use add: anAssociation over at:put: here? The latter is more idiomatic and does not use the implementation detail that a dictionary is made up of associations.

<commits at source.squeak.org<mailto:commits at source.squeak.org>> schrieb am Fr., 15. Nov. 2019, 13:59:
A new version of Collections was added to project The Inbox:

==================== Summary ====================

Name: Collections-ct.860
Author: ct
Time: 15 November 2019, 1:58:56.418005 pm
UUID: f6364e7f-08c8-694a-9060-21bc0a0c28d4
Ancestors: Collections-pre.857

Add convenience constructor for Dictionary

Dictionary fromKeys: 'wasd' values: '8426'

=============== Diff against Collections-pre.857 ===============

Item was added:
+ ----- Method: Dictionary class>>fromKeys:values: (in category 'instance creation') -----
+ fromKeys: keys values: values
+       | dictionary |
+       self assert: [keys size = values size].
+       dictionary := self new: keys size.
+       keys with: values do: [:key :value |
+               dictionary add: key -> value].
+       ^ dictionary!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20191117/4d37e5cd/attachment.html>

More information about the Squeak-dev mailing list