[REBOL] Re: Trimming values from a series?
From: edanaii:cox at: 24-Jul-2002 17:32
Carl Read wrote:
>On 24-Jul-02, Brett Handley wrote:
>
>>Louis has already pointed out Unique
>>
>
>>If you need your series sorted, it is probably better to sort after
>>the Unique. This way you don't need to hope that Unique keeps the
>>sorting intact.
>>
>
>> sort unique [ "a" "b" "b" "c" "d" "e" "e" ]
>>
>
>Hmmm. Are there cases where unique can change the order, as well as
>stripping out duplicates?
>
I would expect that UNIQUE first sorts the data in order to trim out the
duplicates. It's the most efficient way to find and remove them. Which
is why I went looking for it in SORT first.
I doubt that issuing SORT and UNIQUE in any combination is faster
because of the redundancy.
I could be wrong, though...
--
Sincerely, | For long you live and high you fly.
Ed Dana | And smiles you'll give and tears you'll cry.
Software Developer | And all you touch and all you see,
1Ghz Athlon Amiga | Is all your life will ever be.
| -- Pink Floyd, Breathe.