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

Marcel Taeumel marcel.taeumel at hpi.de
Tue Nov 16 10:28:41 UTC 2021

Hi Christoph --

It looks strange that you want to make a private interface public by providing a convenience constructor. For the few cases, where you actually want to initialize a Bag with specific counts ... maybe really just use #setContents:? I mean, I would not want to promote this interface that much.

Would you elaborate on the scenario?

Am 13.11.2021 02:29:24 schrieb commits at source.squeak.org <commits at source.squeak.org>:
A new version of Collections was added to project The Inbox:

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

Name: Collections-ct.962
Author: ct
Time: 13 November 2021, 2:29:12.457577 am
UUID: 762c672f-abb5-194e-9f54-14cce19aa7f9
Ancestors: Collections-pre.961

Adds convenience constructor to Bag.

Bag newFromContents: (Dictionary new at: #mon put: 7; at: #tue put: 2; at: #wed put: 4; yourself).

=============== Diff against Collections-pre.961 ===============

Item was added:
+ ----- Method: Bag class>>newFromContents: (in category 'instance creation') -----
+ newFromContents: aDictionary
+ ^ self new setContents: aDictionary!

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

More information about the Squeak-dev mailing list