From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bruce Korb Newsgroups: gmane.lisp.guile.devel Subject: Re: Guile: What's wrong with this? Date: Tue, 03 Jan 2012 08:26:41 -0800 Message-ID: <4F032C41.3070300@gmail.com> References: <4F027F35.5020001@gmail.com> <1325603029.22166.YahooMailNeo@web37906.mail.mud.yahoo.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1325608015 6326 80.91.229.12 (3 Jan 2012 16:26:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 3 Jan 2012 16:26:55 +0000 (UTC) Cc: gnu-prog-discuss@gnu.org, guile-devel Development To: Mike Gran Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Jan 03 17:26:51 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 1Ri7CM-0000Oh-GH for guile-devel@m.gmane.org; Tue, 03 Jan 2012 17:26:50 +0100 Original-Received: from localhost ([::1]:55714 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ri7CL-0005Il-Qu for guile-devel@m.gmane.org; Tue, 03 Jan 2012 11:26:49 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:48513) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ri7CI-0005DH-9t for guile-devel@gnu.org; Tue, 03 Jan 2012 11:26:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ri7CH-0007km-6x for guile-devel@gnu.org; Tue, 03 Jan 2012 11:26:46 -0500 Original-Received: from mail-iy0-f169.google.com ([209.85.210.169]:43106) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ri7CH-0007kf-1v; Tue, 03 Jan 2012 11:26:45 -0500 Original-Received: by iacb35 with SMTP id b35so34206879iac.0 for ; Tue, 03 Jan 2012 08:26:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=cZ/sjd0ivQ2ER9qZ5DbaWYyVV2ihJvqZ5aaHttgEufA=; b=sc1+vcXWVPOKgboYvR4xZ2S4TGqyFbhlkovDcoegqnF8za1R/uPx7lVpKAG5LA5ia3 SZduaRn0ztkz3odN/R23vxkui66nlghpe/ys/THkep4clvtNzq1OWV6ffXYnOV3IKE0d jLmgV/KHHbV7X8X04RktNHYDwv8Uo6E55t4/g= Original-Received: by 10.42.152.65 with SMTP id h1mr42007875icw.50.1325608004316; Tue, 03 Jan 2012 08:26:44 -0800 (PST) Original-Received: from [10.0.0.2] (adsl-75-0-189-83.dsl.pltn13.sbcglobal.net. [75.0.189.83]) by mx.google.com with ESMTPS id 5sm1292974ibe.8.2012.01.03.08.26.42 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 03 Jan 2012 08:26:43 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111220 Thunderbird/9.0 In-Reply-To: <1325603029.22166.YahooMailNeo@web37906.mail.mud.yahoo.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.169 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:13234 Archived-At: Hi Mike, Thank you for the explanation. However: On 01/03/12 07:03, Mike Gran wrote: >> It worked until I "upgraded" to openSuSE 12.1. >> >>> $ guile --version >>> guile (GNU Guile) 2.0.2 >>> ..... >>> (set! tmp-text (get "act-text")) >>> (set! TMP-text (string-upcase tmp-text)) >>> ERROR: In procedure string-upcase: >>> ERROR: string is read-only: "" >> > > There does seem to be some strangeness w.r.t. read-only > strings going on. > > On Guile 1.8.8 if you create a string this way, it is > not read-only. > > guile> (define y "hello") > guile> (string-set! y 0 #\x) > guile> y > "xello" > > On Guile 2.0.3, if you create a string the same way, it > is read-only for some reason. > > scheme@(guile-user)> (define y "hello") > scheme@(guile-user)> (string-set! y 0 #\x) > ERROR: In procedure string-set!: > ERROR: string is read-only: "hello" > > %string-dump can be used to confirm this There are a couple of issues: 1. "string-upcase" should only read the string (as opposed to "string-upcase!", which rewrites it). 2. it is completely, utterly wrong to mutilate the Guile library into such a contortion that it interprets this: (define y "hello") to be a request to create an immutable string anyway. It very, very plainly says, "make 'y' and fill it with the string "hello". Making it read only is crazy. Furthermore, I do not even have an obvious way to deal with the problem, short of a massive rewrite. I define variables this way all over the place. rewriting the code to (define y (string-append "hell" "o")) everywhere is stupid, laborious, time consuming for me, and time consuming at execution time. Guile 2.0.1, 2.0.2 and 2.0.3 need some rethinking. Dang!!!!!