[squeak-dev] The Inbox: Collections-ct.962.mcz
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 ====================
Time: 13 November 2021, 2:29:12.457577 am
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...
More information about the Squeak-dev