unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: "Michael Gran" <spk121@yahoo.com>
Cc: guile-devel@gnu.org
Subject: Re: [Guile-commits] GNU Guile branch, string_abstraction2, updated. fc50695e8d6a5cc0cebc3a8fcd0833ec1ff316a2
Date: Fri, 05 Jun 2009 16:10:55 +0200	[thread overview]
Message-ID: <87d49ibwk0.fsf@gnu.org> (raw)
In-Reply-To: <E1MCZex-00070s-SB@cvs.savannah.gnu.org> (Michael Gran's message of "Fri, 05 Jun 2009 13:40:40 +0000")

Hi Mike,

A few random thoughts:

"Michael Gran" <spk121@yahoo.com> writes:

> -  buf = scm_to_locale_stringn (scm_c_substring (str, start, end), &len);
> +  buf = scm_to_encoded_stringn (scm_c_substring (str, start, end), &len, 
> +				pt->encoding, pt->ilseq_handler);

I'd call that `scm_to_stringn ()' since it's the most generic form (and
a string is always "encoded", anyway).

> +SCM_DEFINE (scm_setencoding, "setencoding", 1, 1, 0,
> +	    (SCM enc, SCM port),

How about `set-port-encoding!' (for consistency with other procedure
names), with PORT being a required argument?

>  	    "Sets the character encoding that will be used to interpret all\n"
> -	    "port I/O.  Normally, one would set this using @code{setlocale},\n"
> +	    "port I/O.  Normally, a new port would inherit the encoding\n"
> +	    "set by using @code{setlocale},\n"

It would seem simpler to me if a port's encoding defaulted to ASCII,
instead of the current locale's encoding.  That would make semantics
clearer and easier to follow.  What do you think?

> +SCM_DEFINE (scm_setbinary, "setbinary", 0, 1, 0,
> +	    (SCM port),

Likewise, `set-port-binary-mode!' or some such.

> +char *
> +scm_scan_for_encoding (SCM port)

Since it's `SCM_INTERNAL', I'd suggest `scm_i_scan_for_encoding()'.

In addition, from a memory management viewpoint, it might be easier to
have it return an `SCM'.

> -SCM_DEFINE (scm_set_conversion_error_behavior_x, "set-conversion-error-behavior!",

I'm wondering whether this should be a per-port (eventually,
per-transcoder) setting.  What's your opinion?

Thanks,
Ludo'.




       reply	other threads:[~2009-06-05 14:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1MCZex-00070s-SB@cvs.savannah.gnu.org>
2009-06-05 14:10 ` Ludovic Courtès [this message]
2009-06-05 14:26   ` [Guile-commits] GNU Guile branch, string_abstraction2, updated. fc50695e8d6a5cc0cebc3a8fcd0833ec1ff316a2 Mike Gran
2009-06-06 13:23     ` Ludovic Courtès
2009-06-08  4:51       ` Mike Gran
2009-06-18 20:18         ` 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=87d49ibwk0.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guile-devel@gnu.org \
    --cc=spk121@yahoo.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).