Begin forwarded message:
From: Bert Freudenberg <bert@freudenbergs.de>
Subject: Re: [squeak-dev] IdentitySet>>collect:
Date: 1 Dec 2014 11:35:00 CET
To: The general-purpose Squeak developers list <squeak-dev@lists.squeakfoundation.org>
Reply-To: The general-purpose Squeak developers list <squeak-dev@lists.squeakfoundation.org>
On 01.12.2014, at 07:35, Colin Putney <colin@wiresong.com> wrote:
On Sun, Nov 30, 2014 at 6:20 AM, Bert Freudenberg <bert@freudenbergs.de> wrote:
��How would you define ���type��� here? Same class?
Yes, same class. It might be reasonable to answer instances of analogous classes for weak collections, and expect the caller to use #collect:as: if they want to retain weakness.��
Colin
That���s certainly simple:
�����collect: returns a collection of the same class as the receiver, except for weak collections, which answer non-weak equivalents. To return a collection of a different class, use collect:as:"
- Bert -
The above definition makes perfect sense to me. The default should be simple and predictable, the more complex and special cases can be handled by a more convoluted API.
And we should change callers that depend on the old behaviour.
Sven