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: What's wrong with this? Date: Fri, 6 Jan 2012 05:37:55 -0800 (PST) Message-ID: <1325857075.77324.YahooMailNeo@web37903.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> 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 1325857090 15841 80.91.229.12 (6 Jan 2012 13:38:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 6 Jan 2012 13:38:10 +0000 (UTC) Cc: Bruce Korb , "guile-devel@gnu.org" To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Jan 06 14:38:05 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 1Rj9zh-0006Uc-MK for guile-devel@m.gmane.org; Fri, 06 Jan 2012 14:38:05 +0100 Original-Received: from localhost ([::1]:46364 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rj9zg-0008J4-SM for guile-devel@m.gmane.org; Fri, 06 Jan 2012 08:38:04 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:54002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rj9ze-0008Iz-Qn for guile-devel@gnu.org; Fri, 06 Jan 2012 08:38:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rj9zZ-0004Bh-2l for guile-devel@gnu.org; Fri, 06 Jan 2012 08:38:02 -0500 Original-Received: from nm21.bullet.mail.ac4.yahoo.com ([98.139.52.218]:44782) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Rj9zY-0004BZ-Tc for guile-devel@gnu.org; Fri, 06 Jan 2012 08:37:57 -0500 Original-Received: from [98.139.52.190] by nm21.bullet.mail.ac4.yahoo.com with NNFMP; 06 Jan 2012 13:37:56 -0000 Original-Received: from [98.139.52.178] by tm3.bullet.mail.ac4.yahoo.com with NNFMP; 06 Jan 2012 13:37:56 -0000 Original-Received: from [127.0.0.1] by omp1061.mail.ac4.yahoo.com with NNFMP; 06 Jan 2012 13:37:56 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 136263.15175.bm@omp1061.mail.ac4.yahoo.com Original-Received: (qmail 89668 invoked by uid 60001); 6 Jan 2012 13:37:55 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1325857075; bh=pAqqsMns/fSF2qjIANsmfofJDWlkA909THkzClXcuaA=; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=1eZ2Kz1aZBcteA3LbgdbQXsJcp/2kWARsG3b2mHBIXnG4k+rGMZz1Q+bboYBeBG1BQpjTL/Hn/r0Is3slmcWQWu2ltpMXCK3VoXctSkN8Ly3Dhunqyts6mkuTv+x98DA3BacGboansApyTVeLQCTKP91/4cz8x4hLygzrzdxHXI= 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:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=Hyt4eKNLgUeXMB5WdWpF21evUxSKCfjodm/pegt/RhJwvNwKf0o94ZRXYeB77erqzVgePfLhUKwnGR06xLPJEVzxaF+kKjIIs9P8wBhzJ+k0p/1uWyItSwkXH37bIVAntMkz9M7OyV6EloaCZwyRHdQm8YdHKOZeok0n3ZU39tc=; X-YMail-OSG: 2sYsQo4VM1lBxhxZW58A_0eNKG3_sleCs9I_quIfq9OlOjW ldxTU.REhXeQj5qUV.dvAAMFuXr5QCNBo2WjY.j.BzG136a8LdPjDqVBvYIS QYxBrcilBLEHxCwdTZA9FlUqa0z993fNEz21EcE3dYG0my.STvpwz_1Np3qw ztNYdCGVEWT0KItZ7KTrslVBpZ1PDDeUjWCfV_0o4PUf7f_.3M1jw7jJJNuV UQl_ELdY5DyqbHT6LT3kU_F.d5INvnm59MYLtGU6ukQHNzdPqvv12Q2ObQGp ueUgtmMr9IvaVenxoBDnL5qgvvjcLa2L7v335WVlBlnzgYpj5Zn7Fz0T01wf s6mQF9Bm1nFCnbsvBnzy.sDoCs8zGptjp68AqFH.snYIEccZsVjA18pEh56q W42nFKKTl0n23_aAA7IQlSATRAR8AysHtC03FRUIsFVmuurzvab5JW5AFKhi 4e8s- Original-Received: from [71.130.220.24] by web37903.mail.mud.yahoo.com via HTTP; Fri, 06 Jan 2012 05:37:55 PST X-Mailer: YahooMailWebService/0.8.115.331698 In-Reply-To: <87wr95bo9y.fsf@netris.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 98.139.52.218 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:13350 Archived-At: > From: Mark H Weaver =0A=A0>> It is curious that action o= f 'copy' really means the=0A>> action of 'create a copy with different pro= perties'.=0A>> =A0=0A>> Shouldn't (string-copy "a") create another immuta= ble string?=0A> =0A> Why would you want to copy an immutable string?=0A> = =0A>> Likewise, shouldn't (substring "abc" 1) return an immutable =0A> sub= string?=0A=0AI was being too snarky and rhetorical.=A0 Gotta stop writing e= -mail=0Abefore getting coffee.=0A=A0=0ATo say something possibly semi-const= ructive...=0A=A0=0AThe word 'string' in Scheme is overloaded to mean both s= tring=0Aimmutables=A0and string mutables.=A0=A0 Since a string immutable=0A= can't be modified to be a mutable, they really are different=0Aobject types= .=A0=A0String mutables appear to still exist in=A0the =0Alatest draft of=A0= R7RS.=A0=0A=A0=0AMany of the procedures that operate on strings will are ov= erloaded=0Ato take both immutables and mutables, but some, like string-set!= =0Atake only mutables.=0A=A0=0AThere is an obvious syntax to construct a st= ring immutable=0Aobject: namely to have it appear as a literal in the sourc= e code.=0AThere thus isn't a need for a constructor function.=0A=A0=0AThere= is a need for a constructor function to create string mutables,=0Abecause = a literal string in the source code indicates a string immutable.=0A=A0=0AT= here are such constructors: (string ...) and (make-string k )= =0Awhich is fine.=0A=A0=0ABut there is no constructor for a string mutable = that initializes=0Ait=A0with a string in Guile 2.0.=A0 There was in Guile 1= .8, where=0Ayou could do (define ). =0A=A0=0ASo = instead, syntactically, we now have to use=A0'string-copy' or 'substring'= =0Afor its *side-effects*, namely that it doesn't mark the copy immutable.= =0AThose are rather poor and confusing names for constructors.=0A=A0=0AIf m= aking such a suggestion weren't pointless, I'd pitch the idea=0Aof overload= ing 'string' or 'make-string' so they can be used as=0Aa constructor=A0of a= string mutable.=A0 Something like=0A(string ) or (make-str= ing ).=A0 This=0Awould be clearer than using string-copy, I= think.=0A=A0=0AThanks,=0A=A0=0AMike