Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: Trimming values from a series?

From: carl:cybercraft at: 25-Jul-2002 16:24

On 25-Jul-02, Ed Dana wrote:
> Sorting this string, for example, produces the following results: >>> UNIQUE "Now is the time for all good men to come to the aid of > their country" > == "Now isthemfralgdcuy" > Which suggests that either UNIQUE uses some other algorithm, or it > sorts it and then puts it back to its original form. The latter, > would be very inefficient, of course, so I vote for the former. > Maybe the algorithm is something similar to what's used for some > compression schemes?
Getting the unique values from a string would be simple. Just have an array of 256 flags and tick them as found based on the char values as you parse once through the string. Blocks of mixed datatypes wouldn't be quite so easy though... -- Carl Read