From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mike Gran Newsgroups: gmane.lisp.guile.devel Subject: Re: [Guile-commits] GNU Guile branch, master, updated. release_1-9-2-164-g0d05ae7 Date: Tue, 08 Sep 2009 21:16:34 -0700 Message-ID: <1252469794.24639.20.camel@localhost.localdomain> References: <87fxaxavog.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1252469842 9906 80.91.229.12 (9 Sep 2009 04:17:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 9 Sep 2009 04:17:22 +0000 (UTC) Cc: guile-devel@gnu.org To: Ludovic =?ISO-8859-1?Q?Court=E8s?= Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Sep 09 06:17:15 2009 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MlEcL-0002j8-S1 for guile-devel@m.gmane.org; Wed, 09 Sep 2009 06:17:14 +0200 Original-Received: from localhost ([127.0.0.1]:49441 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MlEcK-0000ND-Ub for guile-devel@m.gmane.org; Wed, 09 Sep 2009 00:17:12 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MlEcI-0000MP-FS for guile-devel@gnu.org; Wed, 09 Sep 2009 00:17:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MlEcH-0000Ks-HP for guile-devel@gnu.org; Wed, 09 Sep 2009 00:17:09 -0400 Original-Received: from [199.232.76.173] (port=35894 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MlEcH-0000Kg-CC for guile-devel@gnu.org; Wed, 09 Sep 2009 00:17:09 -0400 Original-Received: from smtp101.prem.mail.sp1.yahoo.com ([98.136.44.56]:27992) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1MlEcG-0001DU-Ez for guile-devel@gnu.org; Wed, 09 Sep 2009 00:17:09 -0400 Original-Received: (qmail 91203 invoked from network); 9 Sep 2009 04:17:07 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:Subject:From:To:Cc:In-Reply-To:References:Content-Type:Date:Message-Id:Mime-Version:X-Mailer:Content-Transfer-Encoding; b=jy4QkG/wXIdyediWqLudQgPukPgPZzDMqYVAbeCF9Y6D6gwA5+aLSlYyOIILGckmKczvxeH8zsyG9mgfecovwFMGz5NtY57T36LlFm+8U/LExVIcEvnm9hC7NnAgVVk+dmD4bEIzKtThqnef7C+0bEj3ElbKjCwrIlBAiz2t3AU= ; Original-Received: from adsl-71-130-218-93.dsl.irvnca.pacbell.net (spk121@71.130.218.93 with plain) by smtp101.prem.mail.sp1.yahoo.com with SMTP; 08 Sep 2009 21:17:07 -0700 PDT X-Yahoo-SMTP: FzNaA9iswBDuBl1BmgaIRDaP9Q-- X-YMail-OSG: ttVVBcoVM1kVfuu34EalPPVpW6JEzHj9_Q42AF9NGJwsNMwr.rC46FchC9gdjcKbflusKss.X25pwPyCcydHDdQ7G_QrHJbHT3pLyO3F4A7YEWwzCUaBPp5AmXNKaBlGqpXh2lbOY7j2x5P2Zzln7DW2DHqKFPIMFKbEqmtTCrAgBFYs.5WspyMlirTXZQqhWrMb5SB3RjV057_FvawBFhTcXZ_YTK43ACqbzZxS4_dopsjQfj2hq4t7INISrR8oQ1ERNW2x.gap5oEzbG_iB2rlCuRagPyRjOuj X-Yahoo-Newman-Property: ymail-3 In-Reply-To: <87fxaxavog.fsf@gnu.org> X-Mailer: Evolution 2.24.5 (2.24.5-2.fc10) X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (2) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:9286 Archived-At: On Wed, 2009-09-09 at 01:00 +0200, Ludovic Courtès wrote: > Hello! > > "Michael Gran" writes: > > > http://git.savannah.gnu.org/cgit/guile.git/commit/?id=0d05ae7c4b1eddf6257f99f44eaf5cb7b11191be > > [...] > > > - return scm_getc (input_port); > > + return scm_get_byte_or_eof (input_port); > > This is actually an earlier change, but the prototype of scm_getc is now > different from that in 1.8. Presumably, this means that it’s not > source-compatible with 1.8, e.g., on platforms where > sizeof (int) < sizeof (scm_t_wchar), right? The readline library can't handle UCS-4 codepoints, but, it is capable of dealing with locale-encoded text. So, it needs to have the raw bytes of the locale-encoded characters, and scm_get_byte_or_eof returns the raw bytes. > > > --- a/libguile/strings.h > > +++ b/libguile/strings.h > > @@ -111,7 +111,7 @@ SCM_API SCM scm_substring_shared (SCM str, SCM start, SCM end); > > SCM_API SCM scm_substring_copy (SCM str, SCM start, SCM end); > > SCM_API SCM scm_string_append (SCM args); > > > > -SCM_INTERNAL SCM scm_i_from_stringn (const char *str, size_t len, > > +SCM_API SCM scm_i_from_stringn (const char *str, size_t len, > > const char *encoding, > > scm_t_string_failed_conversion_handler > > handler); > > @@ -157,7 +157,7 @@ SCM_INTERNAL const scm_t_wchar *scm_i_string_wide_chars (SCM str); > > SCM_INTERNAL SCM scm_i_string_start_writing (SCM str); > > SCM_INTERNAL void scm_i_string_stop_writing (void); > > SCM_INTERNAL int scm_i_is_narrow_string (SCM str); > > -SCM_INTERNAL scm_t_wchar scm_i_string_ref (SCM str, size_t x); > > +SCM_API scm_t_wchar scm_i_string_ref (SCM str, size_t x); > > Were these changes intended? Well, one of the two of them was intended. :) > > > + (with-locale "en_US.iso88591" > > + (pass-if-exception "no args" exception:wrong-num-args > > + (regexp-quote)) > > Is the locale part of the API? That is, should programs that use > regexps explicitly ask for a locale with 8-bit encoding? Basically yes. On Wed, 2009-09-09 at 01:00 +0200, Ludovic Courtès wrote: > Hello! > > "Michael Gran" writes: > > > http://git.savannah.gnu.org/cgit/guile.git/commit/?id=0d05ae7c4b1eddf6257f99f44eaf5cb7b11191be > > [...] > > > - return scm_getc (input_port); > > + return scm_get_byte_or_eof (input_port); > > This is actually an earlier change, but the prototype of scm_getc is now > different from that in 1.8. Presumably, this means that it’s not > source-compatible with 1.8, e.g., on platforms where > sizeof (int) < sizeof (scm_t_wchar), right? The readline library can't handle UCS-4 codepoints, but, it is capable of dealing with locale-encoded text. So, it needs to have the raw bytes of the locale-encoded characters, and scm_get_byte_or_eof returns the raw bytes instead of doing the processing necessary to make codepoints. > > > --- a/libguile/strings.h > > +++ b/libguile/strings.h > > @@ -111,7 +111,7 @@ SCM_API SCM scm_substring_shared (SCM str, SCM start, SCM end); > > SCM_API SCM scm_substring_copy (SCM str, SCM start, SCM end); > > SCM_API SCM scm_string_append (SCM args); > > > > -SCM_INTERNAL SCM scm_i_from_stringn (const char *str, size_t len, > > +SCM_API SCM scm_i_from_stringn (const char *str, size_t len, > > const char *encoding, > > scm_t_string_failed_conversion_handler > > handler); > > @@ -157,7 +157,7 @@ SCM_INTERNAL const scm_t_wchar *scm_i_string_wide_chars (SCM str); > > SCM_INTERNAL SCM scm_i_string_start_writing (SCM str); > > SCM_INTERNAL void scm_i_string_stop_writing (void); > > SCM_INTERNAL int scm_i_is_narrow_string (SCM str); > > -SCM_INTERNAL scm_t_wchar scm_i_string_ref (SCM str, size_t x); > > +SCM_API scm_t_wchar scm_i_string_ref (SCM str, size_t x); > > Were these changes intended? Well, one of the two of them was intended. :) > > > + (with-locale "en_US.iso88591" > > + (pass-if-exception "no args" exception:wrong-num-args > > + (regexp-quote)) > > Is the locale part of the API? That is, should programs that use > regexps explicitly ask for a locale with 8-bit encoding? Basically yes. The libc regex is 8-bit, and it uses scm_to/from_locale_string to convert regex's input and output. Until libunistring comes with Unicode regex, I think this is the best we can do. Thanks, Mike