What is the old behavior? In addition it would be good to have tests for such core library. Stef Le 1/12/14 11:44, Sven Van Caekenberghe a écrit :
Begin forwarded message:
*From: *Bert Freudenberg <bert@freudenbergs.de <mailto: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 <mailto:squeak-dev@lists.squeakfoundation.org>> *Reply-To: *The general-purpose Squeak developers list <squeak-dev@lists.squeakfoundation.org <mailto:squeak-dev@lists.squeakfoundation.org>>
On 01.12.2014, at 07:35, Colin Putney <colin@wiresong.com <mailto:colin@wiresong.com>> wrote:
On Sun, Nov 30, 2014 at 6:20 AM, Bert Freudenberg <bert@freudenbergs.de <mailto: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