guile-devel
[Top][All Lists]
Advanced

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

Re: Unicode and Guile


From: Andy Wingo
Subject: Re: Unicode and Guile
Date: Fri, 31 Oct 2003 15:25:25 +0200
User-agent: Mutt/1.5.4i

Hi Tom,

On Sat, 25 Oct 2003, Tom Lord wrote:

> What do the index arguments to STRING-REF and STRING-SET refer to?
> Byte positions or character positions?

From (r5rs)Strings,

  The _length_ of a string is the number of characters that it contains.
  This number is an exact, non-negative integer that is fixed when the
  string is created.  The "valid indexes" of a string are the exact
  non-negative integers less than the length of the string.  The first
  character of a string has index 0, the second has index 1, and so on.

Clearly, the intention is not to specify the underlying representation.
It would not be Correct to allow string-ref to "leak out" details about
the underlying representation, by referencing partial characters for
instance.

> There's a need for a new type, `text', which acts like the text
> contents of an emacs buffer and has (yes I agree) pretty much the
> Emacs interface. It should all be designed so that, internally, people
> can write new ways to represent text objects and multiple text object
> representations can coexist in the same application (just like emacs).
> There's no good reason not to throw in attributes, overlays, and
> markers for text objects too (just like emacs).

Maybe. This issue is, in my opinion, orthogonal to simple strings.

Users of guile-gtk (the -gobject 2.0 branch) will just use GtkTextBuffer
(and its associated view, GtkTextView). Those that pine after emacs
won't be satisfied until you can read mail in your text buffer ;)

Regards,

wingo.




reply via email to

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