swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Example of sets and indexing


From: Ajoy Victor
Subject: Re: Example of sets and indexing
Date: Sun, 25 Jul 1999 22:05:44 -0500

>     l = [List createBegin: aZone];
>     [l setIndexFromMemberLoc: offsetof (Integer, link)];
>     l = [l createEnd];

Could you please explain some more how this line:

[l setIndexFromMemberLoc: offsetof (Integer, link)];

ensures unique members in the list.

> OrderedSet is a thin veneer on List w/ setIndexFromMemberLoc:.  Since
> the implementation isn't much more than that, and doesn't actually
> completely implement KeyedCollection as you might expect, I'd say
> use the lower-level interface directly; it seems more honest.
> Alternatively, use a Map with the key and member being the same.

I should not use the Set collection that is apparent. Are you saying here I can 
use OrderedSet because it's not implemented as Set. Or that using 
"the lower-level interface" of the OrderedSet collection is a safer alternative
to use Set (How does this lower-level interface work?).

The thing is I need a Set abstraction be it based on List, OrderSet or Map
but I need to understand at least one way. What do you advice me?

Daniel


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]