[squeak-dev] The Inbox: Collections-mt.832.mcz

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Fri May 10 09:45:38 UTC 2019


Le ven. 10 mai 2019 à 10:25, Marcel Taeumel <marcel.taeumel at hpi.de> a
écrit :

> I think that "first" in the name would not work for an arbitrary
> collection, which might not have any order at all. "copy" sounds too
> low-level.
>
> Agree, we already have #first: for the Sequenceable kind...

I do like #slice:. The name #take: is inspired from libraries for other
> languages and database frameworks. Yet, #slice: might also be better for
> randomized sampling (if desired) than #take:.
>
> Then, we have #anyOne. So, what about #some:? ... or #anySome:? :-D
>
> Yes, that's what I thought when you posted; just #any:
But #take: is a good name

Best,
> Marcel
>
> Am 10.05.2019 09:22:12 schrieb K K Subbu <kksubbu.ml at gmail.com>:
> On 10/05/19 11:34 AM, Marcel Taeumel wrote:
> > Hmmm...
> >
> > (Set withAll: (1 to: 11)) take: 4 "-> e.g. #(1 2 3 4)"
> > (Set withAll: (1 to: 11)) size take: 4 "-> 330"
>
> May I suggest using #slice: or #copyFirst: for collections?
>
> slice: 10
> copyFirst: 10
>
>
> Regards .. Subbu
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190510/ec140fb2/attachment.html>


More information about the Squeak-dev mailing list