[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unicode and Guile

From: Marius Vollmer
Subject: Re: Unicode and Guile
Date: Wed, 12 Nov 2003 17:59:24 +0100
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

Tom Lord <address@hidden> writes:

>     >     (do ((i 0 (1+ i))
>     >          (>= i (text-length text)))
>     >       (... (text-ref text i) ...))
>     > and we'll have trouble implementing this efficiently for graphemes of
>     > variable sizes. [...]
> Integer indexes can be implemented quite efficiently.   Again, imagine
> a splay tree representation of text in which each node is labled with
> its integer offsets.  ("splay" is not the only possible tree type to
> which this idea applies.)

But when you compare splay trees plus integer indices against UTF-8
vectors plus markers, doesn't the UTF+markers method win clearly, in
memory use, in speed and code simplicity (when you assume that texts
are not often modified)?

Also, UTF-8 or similar could often be passed directly to external
functions, maybe.  When we need to do encoding conversions anyway when
a string leaves Guile, then there is probably no point in avoiding
splay trees.

GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405

reply via email to

[Prev in Thread] Current Thread [Next in Thread]