[squeak-dev] IdentitySet>>collect:

Eliot Miranda eliot.miranda at gmail.com
Mon Dec 1 16:29:50 UTC 2014


On Mon, Dec 1, 2014 at 2:35 AM, Bert Freudenberg <bert at freudenbergs.de>
wrote:

> On 01.12.2014, at 07:35, Colin Putney <colin at wiresong.com> wrote:
>
>
> On Sun, Nov 30, 2014 at 6:20 AM, Bert Freudenberg <bert at 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:"
>

except collect: can't possibly do this for Interval.  IMO, reify the idea
of species in the comments for collect: and species and say that collect:
answers something of the same species.  The idea being that species is the
same as class when the receiver is a mutable collection, but some other
suitable class when it doesn't.



-- 
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20141201/3eaf0756/attachment.htm


More information about the Squeak-dev mailing list