From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Matthias Koeppe Newsgroups: gmane.lisp.guile.devel Subject: Re: [Patch] SRFI-13 string-tokenize is wrong Date: Mon, 29 Apr 2002 11:21:14 +0200 Sender: guile-devel-admin@gnu.org Message-ID: References: <87bsc8oom8.fsf@zagadka.ping.de> <87wuuuxr0v.fsf@zagadka.ping.de> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1020072462 29208 127.0.0.1 (29 Apr 2002 09:27:42 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 29 Apr 2002 09:27:42 +0000 (UTC) Cc: Martin Grabmueller , guile-devel@gnu.org, haus@lambda.math.uni-magdeburg.de Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 1727Rd-0007az-00 for ; Mon, 29 Apr 2002 11:27:41 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 1727OC-0002Qf-00; Mon, 29 Apr 2002 05:24:08 -0400 Original-Received: from saturn.math.uni-magdeburg.de ([141.44.75.38]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 1727LS-0002GQ-00 for ; Mon, 29 Apr 2002 05:21:18 -0400 Original-Received: from lambda.math.uni-magdeburg.de (lambda [141.44.75.79]) by saturn.math.uni-magdeburg.de (8.11.6/8.11.6) with ESMTP id g3T9LFJ21804; Mon, 29 Apr 2002 11:21:15 +0200 (MET DST) Original-Received: (from mkoeppe@localhost) by lambda.math.uni-magdeburg.de (8.10.2+Sun/8.10.2) id g3T9LEw05344; Mon, 29 Apr 2002 11:21:14 +0200 (MEST) X-Authentication-Warning: lambda.math.uni-magdeburg.de: mkoeppe set sender to mkoeppe@mail.math.uni-magdeburg.de using -f Original-To: Marius Vollmer In-Reply-To: <87wuuuxr0v.fsf@zagadka.ping.de> (Marius Vollmer's message of "26 Apr 2002 20:18:24 +0200") Original-Lines: 48 User-Agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1.80 (sparc-sun-solaris2.7) Errors-To: guile-devel-admin@gnu.org X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.devel:556 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:556 Marius Vollmer writes: > Thanks; and sorry for being nitpicky: can we be sure that isgraphic is > the same as charset:graphic? We can't. That's why I wrote that TOKEN_SET defaults to "an equivalent" of CHAR-SET:GRAPHIC.=20=20 The whole internationalization stuff is, of course, broken. Some Guile functions depend on the current locale setting; others depend on the locale setting at load time; others silently do ASCII only. This clearly needs to be worked on, but I don't think STRING-TOKENIZE would be the place to start. BTW, when I tried to make an example of the described behavior, I got a segmentation fault caused by an array being indexed by a signed char (on Solaris 2.7 with the Forte compiler): (use-modules (srfi srfi-13) (srfi srfi-14))=20 (string-tokenize "charsets=E4are=E4fun" char-set:graphic) =3D=3D> segfault Here is a fix: --- srfi-14.h.~1.3.2.6.~ Tue Sep 25 13:00:41 2001 +++ srfi-14.h Mon Apr 29 11:13:03 2002 @@ -48,15 +48,15 @@ =20 #define SCM_CHARSET_SIZE 256 =20 -/* We expect 8-bit bytes here. Shoule be no problem in the year +/* We expect 8-bit bytes here. Should be no problem in the year 2001. */ #ifndef SCM_BITS_PER_LONG # define SCM_BITS_PER_LONG (sizeof (long) * 8) #endif =20 #define SCM_CHARSET_GET(cs, idx) (((long *) SCM_SMOB_DATA (cs))\ - [(idx) / SCM_BITS_PER_LONG] &\ - (1L << ((idx) % SCM_BITS_PER_LONG))) + [((unsigned char) (idx)) / SCM_BITS_PER_LONG] &\ + (1L << (((unsigned char) (idx)) % SCM_BITS_PER_LONG))) =20 #define SCM_CHARSETP(x) (!SCM_IMP (x) && (SCM_TYP16 (x) =3D=3D scm_tc16_ch= arset)) =20 --=20 Matthias K=F6ppe -- http://www.math.uni-magdeburg.de/~mkoeppe _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel