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: The empty string and other empty strings Date: Tue, 10 Jan 2012 03:28:27 -0800 (PST) Message-ID: <1326194907.55971.YahooMailNeo@web37901.mail.mud.yahoo.com> References: <4F027F35.5020001@gmail.com> <1325603029.22166.YahooMailNeo@web37906.mail.mud.yahoo.com> <4F032C41.3070300@gmail.com> <87mxa4ifux.fsf@gnu.org> <4F038BF4.1070200@gnu.org> <87obujzmmc.fsf@Kagami.home> <4F048972.5040803@gnu.org> <87lipnm8yx.fsf@Kagami.home> <4F04D01D.5050801@gnu.org> <8762grf28k.fsf@netris.org> <4F05DC47.1000202@gnu.org> <878vlldb4k.fsf@netris.org> <1325811764.22562.YahooMailNeo@web37903.mail.mud.yahoo.com> <87wr95bo9y.fsf@netris.org> <1325857075.77324.YahooMailNeo@web37903.mail.mud.yahoo.com> <877h14bsx0.fsf@netris.org> <4F07747A.4080202@gnu.org> <87sjjsa0kh.fsf@netris.org> <87boqfa8cd.fsf@netris.org> <874nw353a4.fsf_-_@gnu.org> Reply-To: Mike Gran NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1326194925 23930 80.91.229.12 (10 Jan 2012 11:28:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 10 Jan 2012 11:28:45 +0000 (UTC) To: =?iso-8859-1?Q?Ludovic_Court=E8s?= , "guile-devel@gnu.org" Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Jan 10 12:28:41 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RkZse-0002oR-91 for guile-devel@m.gmane.org; Tue, 10 Jan 2012 12:28:40 +0100 Original-Received: from localhost ([::1]:40572 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkZsb-0007ES-AS for guile-devel@m.gmane.org; Tue, 10 Jan 2012 06:28:37 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:33540) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkZsZ-0007E5-Dz for guile-devel@gnu.org; Tue, 10 Jan 2012 06:28:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RkZsT-0006Nx-OT for guile-devel@gnu.org; Tue, 10 Jan 2012 06:28:35 -0500 Original-Received: from nm29.bullet.mail.sp2.yahoo.com ([98.139.91.99]:32170) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RkZsT-0006Nb-7e for guile-devel@gnu.org; Tue, 10 Jan 2012 06:28:29 -0500 Original-Received: from [98.139.91.64] by nm29.bullet.mail.sp2.yahoo.com with NNFMP; 10 Jan 2012 11:28:28 -0000 Original-Received: from [98.139.91.60] by tm4.bullet.mail.sp2.yahoo.com with NNFMP; 10 Jan 2012 11:28:28 -0000 Original-Received: from [127.0.0.1] by omp1060.mail.sp2.yahoo.com with NNFMP; 10 Jan 2012 11:28:28 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 268909.31524.bm@omp1060.mail.sp2.yahoo.com Original-Received: (qmail 85504 invoked by uid 60001); 10 Jan 2012 11:28:27 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1326194907; bh=TnJyexjsHX64y+URq4x0Z6Ws1FJ06cURvMR+oq4x1kY=; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=MVsjb2fqayhMEr1q+9qXvSamRgne3uxzj43O0GlK4o0PnfigezXRHF1G5eUSZMmHnB7ojJK8ek+xtsTvTDfnz3vI5fb7zEiBtguTCvZ6BPywJx2AY833LwiHH+CmViCgrWPmw0q7ycCBF+4+/RWwTFxwQNIZjewLODvetHqh+ew= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=MWoTwIZIk8AuvUNgTdr/QHgNLMaoS5Gj+OBNEErdfFm8qFyq9oHonjST1tg487tMf6PwpQyaFRw6akKM1+0e9hli6tVG/5eMCARNf5s0i8I6e9ogqba02JG56SCWukgnShZkVS945gTZjfaksXVKni+ABPYNZ2PkDon3MvslDSo=; X-YMail-OSG: zwmm7FgVM1mWUz4oxw9KfTeRITdl.4Er4BPJgJYoxGmqLer N5VM8mcm1gxfurH4Ds2DZS7mRdASuE4oEk_6k8RINqn2B6kUkz9bNqGKLuky gBPcoiTfesVO3YdeUuEU_iUqrnSyD_cKVmMNKVQB_phjNLHayEO.3P8KS8RX ci05r82xzTNUu9DwzVsFcaBvVHBCfBamEx6i3x_bZE8P50JgiRzg3IH5LSqL Z5weArlsmJGL6._OmeDgvyr_phhwyqjMOt2UQAQxUcMfEuXwENMSXYy0Wwh6 fpJibzdCrr79xDtZvcyt1U3Vw.YLtlQlF4wqyTO7ZmCsG4YAd8dbTP6S28S. 5uFVobmWu.epOHT_hum_wF6hlMNYTa4cZFhv1BR_TvziFB3PLozMW6G10xgA qaLx0akaCl3Hf6Mcokri8o5Q7QkiNCJjSu0BUMsQOrIaSeWUDqxp_Wet6DXC itaSCIuVfAvjx.OuCkDfatA-- Original-Received: from [71.130.209.171] by web37901.mail.mud.yahoo.com via HTTP; Tue, 10 Jan 2012 03:28:27 PST X-Mailer: YahooMailWebService/0.8.115.331698 In-Reply-To: <874nw353a4.fsf_-_@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 98.139.91.99 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:13460 Archived-At: > From: Ludovic Court=E8s =0A> A related question: can we hav= e both narrow and wide empty strings?=0A=0AThe intention is that a string i= s encoded as wide only if it can't=0Abe encoded as narrow.=A0 So _newly cre= ated_ empty strings should only be narrow.=0A=A0=0ARight now it seems that= =A0zero-length shared substring of a wide string is=0Awide.=A0 A zero-lengt= h substring still shares the=A0stringbuf of the=0Aoriginal string.=0A=A0=0A= (%string-dump=0A=A0 (substring=0A=A0=A0=A0 (apply string (map integer->char= (list 2001 2002 2003)))=0A=A0=A0 3))=0A=A0=0ASo I guess the answer is that= you can have both wide and narrow empty=0Astrings if you believe that zero= -length substrings need to point to a=0Azero-length part of the stringbuf o= f the parent string from which=0Athey were generated.=A0 This is a little p= edantic, but I think it might=0Abe the right answer.=0A=A0=0AWhat do you th= ink about that?=A0 Do zero-length substrings need to=0Astill share stringbu= fs with their parent strings?=0A=A0=0AIn any case, a string-copy of a narro= w substring of an otherwise wide string=0Ashould be a new narrow string.=A0= This should apply to zero-length=0Asubstrings as well.=A0 This isn't happe= ning, because we're missing=0Aa scm_i_try_narrow_string in string-copy, whi= ch is a bug.=0A=A0=0AThanks,=0A=A0=0AMike