unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
Subject: Re: Unicode and Guile
Date: Mon, 17 Nov 2003 18:17:28 +0200	[thread overview]
Message-ID: <20031117161728.GE730@lark> (raw)
In-Reply-To: <200311111902.LAA25202@morrowfield.regexps.com>

On Tue, 11 Nov 2003, Tom Lord wrote:

> Thanks for the pointer to the Python type (on which I won't comment
> :-).   Thanks for the excuse to think about this more.

And thanks for thinking this through a lot more properly than I was, and
for caring about the problem, and for having patience with the ignorant
:-)

> ** CHAR? Makes No Sense In Unicode

I think I'm starting to get a clue. Case mapping demonstrates this
pretty clearly... Incidentally, GLib's function for this is evidently
broken:

gunichar    g_unichar_toupper               (gunichar c);

Although they do have g_utf8_strup, which operates on a string and does
the correct thing.

> * The Proposal
> 
>   The proposal has two parts.   Part 1 introduces a new type, TEXT?, 
>   which is a string-like type that is compatible with Unicode, and
>   a subtype of TEXT?, GRAPHEME?, to represent "conceptual
>   characters". 

Wow, you really have thought a lot more about this than I have.

>   It is important to note that, in general, EQV? and EQUAL?  do _not_
>   test for grapheme equality.  GRAPHEME=? must be used instead.

I can see why EQV? shouldn't test for equality: a precomposed grapheme
can be the same as one made with combining characters. But why not
overload EQUAL?, given that they would display the same (with a suitable
glyph rendering library)? Perhaps this is not possible in portable
Scheme? If this question is ignorant, my apologies.

>   So, texts really need markers that work like those in Emacs:

It does indeed appear so. I withdraw my ridicule of this idea :-P

> * Optional Changes to CHAR? and STRING?
> 
>     ~ TEXT? values contain an "encoding" attribute, just as strings
>       do (utf-8, etc.)

Why should an implementation support more than one encoding, internally?

>     ~ (string? a-text-value) => #t

Would be difficult with Guile, given the C interface... Perhaps if there
were an abstract string type, with "simple strings" as a subtype, then C
functions wanting a string (just for reading) would not call
SCM_STRING_CHARS but scm_string_chars, or the like...

> [I]f I'm sitting in california and write a protable Scheme program
> that generates anagrams of a name, it'd be awefully swell if (a) My
> code doesn't have to "know" anything special about unicode internals;
> (b) my code works when passed her name as input.

Indeed.


Overall, your proposal is IMHO well-thought out, and is of high quality.
I am humbled :). I hope something like this can go into Guile soon.

Cheers,

wingo.


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


  parent reply	other threads:[~2003-11-17 16:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-21 17:15 Unicode and Guile Andy Wingo
2003-10-25 17:08 ` Stephen Compall
2003-10-26  0:03   ` Tom Lord
2003-10-26 12:34     ` Which Encoding? (was Re: Unicode and Guile) Stephen Compall
2003-10-31 13:25     ` Unicode and Guile Andy Wingo
2003-11-03 13:35       ` text buffers (was Re: Unicode and Guile) Stephen Compall
2003-11-03 20:34         ` Tom Lord
2003-11-04 10:04           ` Stephen Compall
2003-11-03 20:31       ` Unicode and Guile Tom Lord
2003-11-06 18:16         ` Andy Wingo
2003-11-11 19:02           ` Tom Lord
2003-11-12  0:29             ` Marius Vollmer
2003-11-12  1:40               ` Tom Lord
2003-11-12  2:30                 ` Marius Vollmer
2003-11-12  4:03                   ` Tom Lord
2003-11-12 16:59                     ` Marius Vollmer
2003-11-17 16:17             ` Andy Wingo [this message]
2003-11-12  0:06           ` Marius Vollmer
2003-11-12  1:27             ` Tom Lord
2003-10-31 13:16   ` Andy Wingo
2003-11-02 21:23 ` Kevin Ryde
2003-11-26 20:35 ` Mikael Djurfeldt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031117161728.GE730@lark \
    --to=wingo@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).