[r6rs-discuss] Unicode issues

William D Clinger will at ccs.neu.edu
Wed Aug 29 11:57:57 EDT 2007


Ludovic Courtes wrote:
> Right, but these look more complex IMO, whereas memoization is really
> orthogonal to the implementation of the "real" `string-{ref,length}'
> (one could implement memoization and `string-set!' on top of an
> immutable string implementation with O(n) `string-{ref,length}'.)

An orthogonal memoization would perform miserably for
typical access patterns if the underlying representation
were UTF-8 or UTF-16.  With those representations, you
need to memoize the mapping from character index to code
unit index.  To an orthogonal memoization, that mapping
wouldn't even be visible.

Will



More information about the r6rs-discuss mailing list