|
From: Donal K. F. <don...@ma...> - 2013-01-18 11:27:36
|
On 18/01/2013 04:59, Joe English wrote: >>From a quick scan through the manpages, it looks like [string length], > [string range], [string index], [string replace], and the regexp operations > are the main things that algorithmically benefit from a UCS-2 representation. > Pretty much everything else can be implemented just as efficiently > on UTF-8. (For that matter so can all the regexp operations, > if we're willing to replace the Spencer engine.) The question is what the proportion of operations that benefit in user code actually is. The relative rates of appearance in the manpages isn't really all that helpful! :-) > ... Well, there's also [string reverse], but if that's ever been used > outside of "How fast can *your* language reverse a string?" shootouts > I've yet to see it. Some algorithms are more easily expressed in reverse. I've used it a few times when doing Rosetta Code tasks IIRC. [lreverse] is more useful. Donal. |