OrderedSet?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

OrderedSet?

Shaping-3
The anyone have an OrderedSet for Dolphin?


Shaping


Reply | Threaded
Open this post in threaded view
|

Re: OrderedSet?

ChanHong Kim
There is no OrderedSet. But you can eliminate duplicates from otehr
collection.
Please refer following code.

----------------------
raw := #(1 3 2 2 7 9 8 8 5 3 0)
set := raw asSet
oc := raw copyWithoutDuplicates
----------------------

In above code, 'set' is bound to "a Set(0 1 2 3 5 7 8 9)" which is not
your
intent, however, 'odc' is bound to "#(1 3 2 7 9 8 5 0)" whic is proper
to your intent.

I'm not sure about these two method's performance, however, you can use
in
many case you want.

Regards.

p.s.: My English is so poor, please pardon.