unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Mike Gran <spk121@yahoo.com>
To: "Andy Wingo" <wingo@pobox.com>, "Ludovic Courtès" <ludo@gnu.org>
Cc: guile-devel@gnu.org
Subject: Re: Unicode ports patch
Date: Tue, 1 Sep 2009 12:19:49 -0700 (PDT)	[thread overview]
Message-ID: <935264.92888.qm@web37907.mail.mud.yahoo.com> (raw)
In-Reply-To: <m3k50i34kp.fsf@pobox.com>

----- Original Message ----
> From: Andy Wingo <wingo@pobox.com>
> To: Ludovic Courtès <ludo@gnu.org>
> Cc: guile-devel@gnu.org
> Sent: Tuesday, September 1, 2009 11:25:26 AM
> Subject: Re: Unicode ports patch
> 
> Hi,
> 
> On Tue 01 Sep 2009 10:19, ludo@gnu.org (Ludovic Courtès) writes:
> 
> > Mike Gran writes:
> >
> >> The latest commit 'Add full Unicode capability to ports and the default
> >> reader' 889975e51accb80491af76fc5db980aeb3edd342 adds the majority of
> >> the functionality for non-ASCII strings.  
> >
> > This patch adds a few functions related to string ports:
> >
> >  * libguile/strports.c: store string ports in locale encoding
> >    (scm_strport_to_locale_u8vector, scm_call_with_output_locale_u8vector)
> >    (scm_open_input_locale_u8vector, scm_get_output_locale_u8vector):
> >    new functions
> >
> > I think it would be nicer if these used bytevectors instead of u8vectors
> > and were locale-independent (which would match the `string->utf8' &
> > co. API).  Also I would make `scm_strport_to_locale_u8vector ()'
> > private.  And finally, it'd be even better if it were documented in the
> > manual.  :-)

I don't understand.  "it would be nicer if *these* ..."

To what does *these* refer: string ports?  It would be nicer if we replace
string ports with bytevector ports?  Or it would be nicer if 
scm_get_output_locale_u8vector was scm_get_output_bytevector?

"it would be nicer if these used bytevectors ... and were *locale-independent*"

It would be nicer if string ports were actually bytevector ports, and that 
they were locale-independent?  Or that scm_get_output_bytevector returned a 
locale-independent (ergo 8-bit or 32-bit) vector?

> >
> > Actually I'm not convinced that `call-with-output-locale-*' and
> > `open-input-locale-*' are useful, precisely because we can use a string
> > port to get a string and then `string->utf8' to get at the string bits.

"We can use a string port to get a string"

If we write to a string port and pop a result string?

"And then use string->utf8 to get at the string bits"

And then convert the result string to a UTF-8 encoded bytevector?

> 
> FWIW, I think I agree with all of Ludovic's comments; though if there is
> a way that we can simply arrange to output bytes to an R6RS binary
> output port, I think there are already efficient means to collect the
> bytes from such a port in a bytevector.

Thanks,
Mike




  reply	other threads:[~2009-09-01 19:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-25 15:06 Unicode ports patch Mike Gran
2009-08-25 19:54 ` dsmich
2009-08-25 19:58 ` Andy Wingo
2009-09-01  8:19 ` Ludovic Courtès
2009-09-01 18:25   ` Andy Wingo
2009-09-01 19:19     ` Mike Gran [this message]
2009-09-01 19:34       ` Ludovic Courtès
2009-09-01 21:08         ` Mike Gran
2009-09-02  8:01           ` Ludovic Courtès

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=935264.92888.qm@web37907.mail.mud.yahoo.com \
    --to=spk121@yahoo.com \
    --cc=guile-devel@gnu.org \
    --cc=ludo@gnu.org \
    --cc=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).