[Glass] Collection for reduced conflicts, allow indexes and #sort: ?

Mariano Martinez Peck marianopeck at gmail.com
Thu Dec 5 08:44:20 PST 2013


On Thu, Dec 5, 2013 at 1:40 PM, Richard Sargent <
richard.sargent at gemtalksystems.com> wrote:

> Regrarding sorting, you cannot impose an order on an unordered collection
> while keeping it unordered.
>
> If you want it to have any kind of ordering, you have to convert it to a
> class which preserves ordering, typically a subclass of Sequenceable
> Collection.
>
Indeed. But there isn't any ordered collection with reduced conflicts nor
to be able to have indexes on it. Right?



> On Dec 5, 2013 8:06 AM, "Mariano Martinez Peck" <marianopeck at gmail.com>
> wrote:
>
>> Hi guys. So...at some point in my app, I have a collection in which I
>> store instances of a persistent class. Imagine class Client, so at some
>> point I have a persistent collection of clients.
>>
>>  Now... I want:
>>
>> 1) Reduced conflict collections
>> 2) Be able to use indexes if I happen to need them later on (as far as I
>> read it needs to be an unordered collection)
>> 3) Be able to sort the collection given a closure
>>
>> Just taking into account 1) and 2) it seems the only option is
>> RcIdentityBag. Problem is that I cannot sort such collection with a simple
>> #sort: aBlockClosure. I saw I have #sortWith:, #sortAsending: etc, but
>> that's not what I need. I need to receive a block closure.
>>
>> I can send #asSortedCollection: aClosure to the RcIdentityBag but that
>> answers an instance of a SortedCollection, not a RcIdentityBag sorted,
>> which is different.
>>
>> Any thoughts?
>>
>> Thanks,
>>
>> --
>> Mariano
>> http://marianopeck.wordpress.com
>>
>> _______________________________________________
>> Glass mailing list
>> Glass at lists.gemtalksystems.com
>> http://lists.gemtalksystems.com/mailman/listinfo/glass
>>
>>


-- 
Mariano
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20131205/f5e12434/attachment.html>


More information about the Glass mailing list