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

Marcel Taeumel marcel.taeumel at hpi.de
Fri May 10 08:25:39 UTC 2019


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.

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

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/16b92dd1/attachment-0001.html>


More information about the Squeak-dev mailing list