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

[REBOL] Re: Algorithm challenge: compacting integers

From: SunandaDH:aol at: 19-Jan-2007 12:27

Peter:
> I presume any solution must run under REBOL Core 2.5.6?
Good question! And the answer is "yes and no" Designing for any earlier version would be a waste of time: SKIMP breaks the garbage collector in previous versions of REBOL, so they can't be used anyway. Any later, and we may not be able to use it immediately in the Library. But a great solution would be another reason nudging us towards updating the version that REBOL.org runs on. So I'd rather people went for the best solution possible. John:
> Instead of 1x3 or 2000x5, would it be better to > have "1-3" and "2000-2005"?
Good question! Sadly, the question is a couple of years too late. I took the design decision to use pairs with the values being [start number]x[run length] and we have 70+ meg of data indexed that way. I do remember trying initially with strings (eg "1-3" and "2000-5") but the parsing added a huge overhead. Whether [start]x[end] would ultimately be better than [start]x[length] I don't know. I chose the current method as it made for shorter files when molded and saved. Sunanda.