GNU logs - #32841, boring messages


Message sent to bug-guile@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#32841: assoc-set fails with dot notation association list
Resent-From: "Hood, Christopher L." <Christopher.Hood@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guile@HIDDEN
Resent-Date: Tue, 25 Sep 2018 20:41:02 +0000
Resent-Message-ID: <handler.32841.B.15379080519969 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 32841
X-GNU-PR-Package: guile
X-GNU-PR-Keywords: 
To: 32841 <at> debbugs.gnu.org
X-Debbugs-Original-To: "bug-guile@HIDDEN" <bug-guile@HIDDEN>
Received: via spool by submit <at> debbugs.gnu.org id=B.15379080519969
          (code B ref -1); Tue, 25 Sep 2018 20:41:02 +0000
Received: (at submit) by debbugs.gnu.org; 25 Sep 2018 20:40:51 +0000
Received: from localhost ([127.0.0.1]:54105 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1g4u8Y-0002ah-SB
	for submit <at> debbugs.gnu.org; Tue, 25 Sep 2018 16:40:51 -0400
Received: from eggs.gnu.org ([208.118.235.92]:41089)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <Christopher.Hood@HIDDEN>)
 id 1g4u22-0002Ov-7O
 for submit <at> debbugs.gnu.org; Tue, 25 Sep 2018 16:34:06 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <Christopher.Hood@HIDDEN>)
 id 1g4u1v-0004b9-OC
 for submit <at> debbugs.gnu.org; Tue, 25 Sep 2018 16:34:01 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,HTML_MESSAGE
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:57508)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <Christopher.Hood@HIDDEN>)
 id 1g4u1v-0004at-Jj
 for submit <at> debbugs.gnu.org; Tue, 25 Sep 2018 16:33:59 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:50681)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <Christopher.Hood@HIDDEN>)
 id 1g4u1u-0003EB-4a
 for bug-guile@HIDDEN; Tue, 25 Sep 2018 16:33:59 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <Christopher.Hood@HIDDEN>)
 id 1g4u1q-0004YI-Vm
 for bug-guile@HIDDEN; Tue, 25 Sep 2018 16:33:58 -0400
Received: from relay2.gtri.gatech.edu ([130.207.199.168]:50202)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <Christopher.Hood@HIDDEN>)
 id 1g4u1q-0004XV-PW
 for bug-guile@HIDDEN; Tue, 25 Sep 2018 16:33:54 -0400
X-ASG-Debug-ID: 1537907621-0768e411429de290001-JmwpyF
Received: from jekyll.core.gtri.org (jekyll.core.gtri.org [10.41.1.48]) by
 relay2.gtri.gatech.edu with ESMTP id oCZQZ6FiazNnrtCW (version=TLSv1.2
 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=NO) for <bug-guile@HIDDEN>;
 Tue, 25 Sep 2018 16:33:41 -0400 (EDT)
X-Barracuda-Envelope-From: Christopher.Hood@HIDDEN
Received: from tybee.core.gtri.org (10.41.1.49) by jekyll.core.gtri.org
 (10.41.1.48) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1531.3; Tue, 25
 Sep 2018 16:33:41 -0400
Received: from kiawah.core.gtri.org (10.41.31.71) by tybee.core.gtri.org
 (10.41.1.49) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1531.3; Tue, 25
 Sep 2018 16:33:41 -0400
Received: from kiawah.core.gtri.org ([fe80::c531:9662:df24:eb8f]) by
 kiawah.core.gtri.org ([fe80::c531:9662:df24:eb8f%15]) with mapi id
 15.01.1531.003; Tue, 25 Sep 2018 16:33:41 -0400
From: "Hood, Christopher L." <Christopher.Hood@HIDDEN>
Thread-Topic: assoc-set fails with dot notation association list
X-ASG-Orig-Subj: assoc-set fails with dot notation association list
Thread-Index: AdRVDdo+LoEZ5wMeSnCiFADPGLln/w==
Date: Tue, 25 Sep 2018 20:33:41 +0000
Message-ID: <d61a791aaa734245ac705bb5196ff18e@HIDDEN>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.41.0.30]
Content-Type: multipart/alternative;
 boundary="_000_d61a791aaa734245ac705bb5196ff18egtrigatechedu_"
MIME-Version: 1.0
X-Barracuda-Connect: jekyll.core.gtri.org[10.41.1.48]
X-Barracuda-Start-Time: 1537907621
X-Barracuda-Encrypted: ECDHE-RSA-AES128-SHA256
X-Barracuda-URL: https://130.207.199.168:443/cgi-mod/mark.cgi
X-Virus-Scanned: by bsmtpd at gtri.gatech.edu
X-Barracuda-Scan-Msg-Size: 5244
X-Barracuda-BRTS-Status: 1
X-Barracuda-Spam-Score: 0.00
X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0
 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=1000.0 tests=HTML_MESSAGE
X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.58347
 Rule breakdown below
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.00 HTML_MESSAGE           BODY: HTML included in message
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-Mailman-Approved-At: Tue, 25 Sep 2018 16:40:49 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

--_000_d61a791aaa734245ac705bb5196ff18egtrigatechedu_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

This fails with code pulled straight out of the Guile manual example (secti=
on 6.6.20.6).

(define capitals '(("New York" . "Albany")
                   ("Oregon"   . "Salem")
                   ("Florida"  . "Miami")))

Okay, that works define to define alist capitals. Now let's try another par=
t of the example:


(set! capitals

      (assoc-set! capitals "Florida" "Tallahassee"))

This yields the error:

ERROR: In procedure assoc-set!:
In procedure set-cdr!: Wrong type argument in position 1 (expecting mutable=
 pair): ("Florida" . "Miami")

I've experienced this behavior with builds of both Guile 2.2.2 and Guile 2.=
2.4.

I'll note that if you define the alist so its initial contents are defined =
using a quasiquote and the cons form instead of dot notation, this error is=
 not reached. I'm not sure if the error is valid or not, but in any case, t=
he code that produces is listed as an valid example in the manual, so that =
doesn't seem right.

chris

--_000_d61a791aaa734245ac705bb5196ff18egtrigatechedu_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:#0563C1;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:#954F72;
	text-decoration:underline;}
pre
	{mso-style-priority:99;
	mso-style-link:"HTML Preformatted Char";
	margin:0in;
	margin-bottom:.0001pt;
	font-size:10.0pt;
	font-family:"Courier New";}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
span.HTMLPreformattedChar
	{mso-style-name:"HTML Preformatted Char";
	mso-style-priority:99;
	mso-style-link:"HTML Preformatted";
	font-family:"Courier New";}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri",sans-serif;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"EN-US" link=3D"#0563C1" vlink=3D"#954F72">
<div class=3D"WordSection1">
<p class=3D"MsoNormal">This fails with code pulled straight out of the Guil=
e manual example (section 6.6.20.6).<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Co=
urier New&quot;">(define capitals '((&quot;New York&quot; . &quot;Albany&qu=
ot;)<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Co=
urier New&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (&quot;Oregon&quot;&nbsp=
;&nbsp; . &quot;Salem&quot;)<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Co=
urier New&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (&quot;Florida&quot;&nbs=
p; . &quot;Miami&quot;)))<o:p></o:p></span></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Okay, that works define to define alist capitals. No=
w let&#8217;s try another part of the example:<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<pre>(set! capitals<o:p></o:p></pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (assoc-set! capitals &quot;Florida&quot=
; &quot;Tallahassee&quot;))<o:p></o:p></pre>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">This yields the error: <o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">ERROR: In procedure assoc-set!:<o:p></o:p></p>
<p class=3D"MsoNormal">In procedure set-cdr!: Wrong type argument in positi=
on 1 (expecting mutable pair): (&quot;Florida&quot; . &quot;Miami&quot;)<o:=
p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">I&#8217;ve experienced this behavior with builds of =
both Guile 2.2.2 and Guile 2.2.4.<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">I&#8217;ll note that if you define the alist so its =
initial contents are defined using a quasiquote and the cons form instead o=
f dot notation, this error is not reached. I&#8217;m not sure if the error =
is valid or not, but in any case, the code that
 produces is listed as an valid example in the manual, so that doesn&#8217;=
t seem right.<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">chris<o:p></o:p></p>
</div>
</body>
</html>

--_000_d61a791aaa734245ac705bb5196ff18egtrigatechedu_--




Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: "Hood, Christopher L." <Christopher.Hood@HIDDEN>
Subject: bug#32841: Acknowledgement (assoc-set fails with dot notation
 association list)
Message-ID: <handler.32841.B.15379080519969.ack <at> debbugs.gnu.org>
References: <d61a791aaa734245ac705bb5196ff18e@HIDDEN>
X-Gnu-PR-Message: ack 32841
X-Gnu-PR-Package: guile
Reply-To: 32841 <at> debbugs.gnu.org
Date: Tue, 25 Sep 2018 20:41:02 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-guile@HIDDEN

If you wish to submit further information on this problem, please
send it to 32841 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
32841: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D32841
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to bug-guile@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#32841: assoc-set fails with dot notation association list
Resent-From: John Cowan <cowan@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guile@HIDDEN
Resent-Date: Tue, 25 Sep 2018 22:06:01 +0000
Resent-Message-ID: <handler.32841.B32841.153791312018267 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 32841
X-GNU-PR-Package: guile
X-GNU-PR-Keywords: 
To: Christopher.Hood@HIDDEN
Cc: 32841 <at> debbugs.gnu.org
Received: via spool by 32841-submit <at> debbugs.gnu.org id=B32841.153791312018267
          (code B ref 32841); Tue, 25 Sep 2018 22:06:01 +0000
Received: (at 32841) by debbugs.gnu.org; 25 Sep 2018 22:05:20 +0000
Received: from localhost ([127.0.0.1]:54140 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1g4vSK-0004kX-2e
	for submit <at> debbugs.gnu.org; Tue, 25 Sep 2018 18:05:20 -0400
Received: from mail-wr1-f51.google.com ([209.85.221.51]:32964)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <cowan@HIDDEN>) id 1g4vSG-0004kH-OU
 for 32841 <at> debbugs.gnu.org; Tue, 25 Sep 2018 18:05:18 -0400
Received: by mail-wr1-f51.google.com with SMTP id f10-v6so3870377wrs.0
 for <32841 <at> debbugs.gnu.org>; Tue, 25 Sep 2018 15:05:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=ccil-org.20150623.gappssmtp.com; s=20150623;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=MskSPsXUiL1Z3l3G3M+h8gKOxjQiRp7kGZious7pfxY=;
 b=mNUYZ+RWiNKIHlfxhRcVP1691JwFmdIBAzOgl0KuNY+g2d3zp3BPcZ0LNuew5f+QMW
 HKXbUafa1p1sW4rPYQ0sjtY5ghPE5GPsp5J6NElyU25LWqNRTv/QQIZvbsM/5Cz5c64F
 TsYmozOtSQVWml2g1BkNZ4x7zP9kNnUSU8jYd5/6Ot6Ij1IoATcfCkwQrc7dxRsvQXEq
 oFcByLhwjElhthimj5cdovBtaJEmg5VNzGKOPtGvNo1dyeHNJogYCLKTM7Uo91RqnRfr
 tlpxkSlO7A8Nie7feZqXSb+v9P92KH0UdF5BudfHTstNcWFiWaLlfGthLYxbwI/xOVNl
 obuA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=MskSPsXUiL1Z3l3G3M+h8gKOxjQiRp7kGZious7pfxY=;
 b=L7WggzkB4pWEue/HGTsoSOsKiJbf/TV+WKcxijSXYFA4qbQPkr4wM0bciah+t3AzMa
 PqFAGHrIONvBrFqaUo35f7goPrqVroWukb253H0w6zsIR0vHtKzznlblDq1j1lxbeoIr
 iSe/QTzQ7k9xk4fp5OwpEtWqkzrdIKu1MS8neHoY3/zmFHFH5/Z7BGpkYn7SrPmPRO6M
 rWAhFQSBII8i+VRCqx9zqXmS/XViiVGun4V43ttCuUSOJvqw4NEq+AaH0FgxQWErnXRI
 byo6hfUOuqXXdPaNsjmqtv+4IeprYz+2VHv7NVyqevkzePvUuYIpGLkwbTXtUbGwTHga
 Lqzw==
X-Gm-Message-State: ABuFfoi4lZEOM/4Z9WQ0ciT8IeJLWEE+fgXWLmsohKAwK/IsYTSoWXhk
 rgd3UcM/JietjLImMctjmK08yao2YlOT5/hnFoOvSA==
X-Google-Smtp-Source: ACcGV617Ty5M7P7EAej8EpdPibslq0YMfdVRTsrCh0WTN7WBBtrPUcn4Yyyh5uv38d4+7ijCOIOQWfg4SG58+lcGeFY=
X-Received: by 2002:a5d:434c:: with SMTP id
 u12-v6mr2586918wrr.189.1537913110926; 
 Tue, 25 Sep 2018 15:05:10 -0700 (PDT)
MIME-Version: 1.0
References: <d61a791aaa734245ac705bb5196ff18e@HIDDEN>
In-Reply-To: <d61a791aaa734245ac705bb5196ff18e@HIDDEN>
From: John Cowan <cowan@HIDDEN>
Date: Tue, 25 Sep 2018 18:04:59 -0400
Message-ID: <CAD2gp_Qvvug7w_rcVQb3_fwAMaaKKRcCO6KS=4HLeGTMn-d1GQ@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000ac204b0576b94c44"
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000ac204b0576b94c44
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

The error is valid, because you are attempting to mutate a program
literal.  Scheme makes that an error, and Guile enforces it (though many
Schemes do not).

On Tue, Sep 25, 2018 at 4:41 PM Hood, Christopher L. <
Christopher.Hood@HIDDEN> wrote:

> This fails with code pulled straight out of the Guile manual example
> (section 6.6.20.6).
>
>
>
> (define capitals '(("New York" . "Albany")
>
>                    ("Oregon"   . "Salem")
>
>                    ("Florida"  . "Miami")))
>
>
>
> Okay, that works define to define alist capitals. Now let=E2=80=99s try a=
nother
> part of the example:
>
>
>
> (set! capitals
>
>       (assoc-set! capitals "Florida" "Tallahassee"))
>
>
>
> This yields the error:
>
>
>
> ERROR: In procedure assoc-set!:
>
> In procedure set-cdr!: Wrong type argument in position 1 (expecting
> mutable pair): ("Florida" . "Miami")
>
>
>
> I=E2=80=99ve experienced this behavior with builds of both Guile 2.2.2 an=
d Guile
> 2.2.4.
>
>
>
> I=E2=80=99ll note that if you define the alist so its initial contents ar=
e defined
> using a quasiquote and the cons form instead of dot notation, this error =
is
> not reached. I=E2=80=99m not sure if the error is valid or not, but in an=
y case,
> the code that produces is listed as an valid example in the manual, so th=
at
> doesn=E2=80=99t seem right.
>
>
>
> chris
>

--000000000000ac204b0576b94c44
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">The error is valid, because you are attempting to mutate a=
 program literal.=C2=A0 Scheme makes that an error, and Guile enforces it (=
though many Schemes do not).</div><br><div class=3D"gmail_quote"><div dir=
=3D"ltr">On Tue, Sep 25, 2018 at 4:41 PM Hood, Christopher L. &lt;<a href=
=3D"mailto:Christopher.Hood@HIDDEN">Christopher.Hood@HIDDEN=
du</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margi=
n:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang=3D"EN-US" link=3D"#0563C1" vlink=3D"#954F72">
<div class=3D"m_6244735662910326147WordSection1">
<p class=3D"MsoNormal">This fails with code pulled straight out of the Guil=
e manual example (section 6.6.20.6).<u></u><u></u></p>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Co=
urier New&quot;">(define capitals &#39;((&quot;New York&quot; . &quot;Alban=
y&quot;)<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Co=
urier New&quot;">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (&quot;Oregon&quot;=C2=
=A0=C2=A0 . &quot;Salem&quot;)<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Co=
urier New&quot;">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (&quot;Florida&quot;=C2=
=A0 . &quot;Miami&quot;)))<u></u><u></u></span></p>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
<p class=3D"MsoNormal">Okay, that works define to define alist capitals. No=
w let=E2=80=99s try another part of the example:<u></u><u></u></p>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
<pre>(set! capitals<u></u><u></u></pre>
<pre>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (assoc-set! capitals &quot;Florida&quot=
; &quot;Tallahassee&quot;))<u></u><u></u></pre>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
<p class=3D"MsoNormal">This yields the error: <u></u><u></u></p>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
<p class=3D"MsoNormal">ERROR: In procedure assoc-set!:<u></u><u></u></p>
<p class=3D"MsoNormal">In procedure set-cdr!: Wrong type argument in positi=
on 1 (expecting mutable pair): (&quot;Florida&quot; . &quot;Miami&quot;)<u>=
</u><u></u></p>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
<p class=3D"MsoNormal">I=E2=80=99ve experienced this behavior with builds o=
f both Guile 2.2.2 and Guile 2.2.4.<u></u><u></u></p>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
<p class=3D"MsoNormal">I=E2=80=99ll note that if you define the alist so it=
s initial contents are defined using a quasiquote and the cons form instead=
 of dot notation, this error is not reached. I=E2=80=99m not sure if the er=
ror is valid or not, but in any case, the code that
 produces is listed as an valid example in the manual, so that doesn=E2=80=
=99t seem right.<u></u><u></u></p>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
<p class=3D"MsoNormal">chris<u></u><u></u></p>
</div>
</div>

</blockquote></div>

--000000000000ac204b0576b94c44--




Message sent to bug-guile@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#32841: assoc-set fails with dot notation association list
Resent-From: Mark H Weaver <mhw@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guile@HIDDEN
Resent-Date: Thu, 27 Sep 2018 03:03:02 +0000
Resent-Message-ID: <handler.32841.B32841.15380173556495 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 32841
X-GNU-PR-Package: guile
X-GNU-PR-Keywords: 
To: "Hood\, Christopher L." <Christopher.Hood@HIDDEN>
Cc: 32841 <at> debbugs.gnu.org
Received: via spool by 32841-submit <at> debbugs.gnu.org id=B32841.15380173556495
          (code B ref 32841); Thu, 27 Sep 2018 03:03:02 +0000
Received: (at 32841) by debbugs.gnu.org; 27 Sep 2018 03:02:35 +0000
Received: from localhost ([127.0.0.1]:55818 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1g5MZX-0001gh-9V
	for submit <at> debbugs.gnu.org; Wed, 26 Sep 2018 23:02:35 -0400
Received: from world.peace.net ([64.112.178.59]:39720)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mhw@HIDDEN>) id 1g5MZV-0001gU-2y
 for 32841 <at> debbugs.gnu.org; Wed, 26 Sep 2018 23:02:33 -0400
Received: from mhw by world.peace.net with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89)
 (envelope-from <mhw@HIDDEN>)
 id 1g5MZP-000383-4q; Wed, 26 Sep 2018 23:02:27 -0400
From: Mark H Weaver <mhw@HIDDEN>
References: <d61a791aaa734245ac705bb5196ff18e@HIDDEN>
Date: Wed, 26 Sep 2018 23:02:17 -0400
In-Reply-To: <d61a791aaa734245ac705bb5196ff18e@HIDDEN> (Christopher
 L. Hood's message of "Tue, 25 Sep 2018 20:33:41 +0000")
Message-ID: <87zhw3d4na.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Christopher,

"Hood, Christopher L." <Christopher.Hood@HIDDEN> writes:
> This fails with code pulled straight out of the Guile manual example
> (section 6.6.20.6).

Indeed, the example code in the manual is bad.  Thanks for bringing this
to our attention.

> (define capitals '(("New York" . "Albany")
>                    ("Oregon"   . "Salem")
>                    ("Florida"  . "Miami")))

As John correctly pointed out, it's an error to mutate a program
literal.  It's analogous to trying to modify a string literal in C.
'assoc-set!' mutates the existing list structure in some cases, and so
it cannot be used on literals such as the one above.

To initialize an alist that will be mutated, you must instead do
something like this:

  (define capitals (list (cons "New York" "Albany")
                         (cons "Oregon"   "Salem")
                         (cons "Florida"  "Miami")))

> I=E2=80=99ll note that if you define the alist so its initial contents are
> defined using a quasiquote and the cons form instead of dot notation,
> this error is not reached.

Yes, that accomplishes essentially the same thing, although note that
quasiquote makes an effort to use program literals for parts of the
resulting list structure, e.g.:

  `(,a ,b c d)

expands to:

  (cons a (cons b '(c d)))

which means that the first two cons cells can be mutated, but the last
two are part of an immutable program literal.

> I=E2=80=99m not sure if the error is valid or not, but in any case, the c=
ode
> that produces is listed as an valid example in the manual, so that
> doesn=E2=80=99t seem right.

Indeed, the manual needs to be fixed.  Sorry for the confusion, and
thanks again for the bug report.

     Mark




Message sent to bug-guile@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#32841: assoc-set fails with dot notation association list
Resent-From: John Cowan <cowan@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-guile@HIDDEN
Resent-Date: Thu, 27 Sep 2018 12:11:02 +0000
Resent-Message-ID: <handler.32841.B32841.153805020518363 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 32841
X-GNU-PR-Package: guile
X-GNU-PR-Keywords: 
To: Mark H Weaver <mhw@HIDDEN>
Cc: 32841 <at> debbugs.gnu.org, Christopher.Hood@HIDDEN
Received: via spool by 32841-submit <at> debbugs.gnu.org id=B32841.153805020518363
          (code B ref 32841); Thu, 27 Sep 2018 12:11:02 +0000
Received: (at 32841) by debbugs.gnu.org; 27 Sep 2018 12:10:05 +0000
Received: from localhost ([127.0.0.1]:55964 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1g5V7N-0004m6-6A
	for submit <at> debbugs.gnu.org; Thu, 27 Sep 2018 08:10:05 -0400
Received: from mail-wr1-f49.google.com ([209.85.221.49]:39293)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <cowan@HIDDEN>) id 1g5V7L-0004lU-4I
 for 32841 <at> debbugs.gnu.org; Thu, 27 Sep 2018 08:10:04 -0400
Received: by mail-wr1-f49.google.com with SMTP id s14-v6so2324816wrw.6
 for <32841 <at> debbugs.gnu.org>; Thu, 27 Sep 2018 05:10:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=ccil-org.20150623.gappssmtp.com; s=20150623;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=X+SzF5UbGZF5HyGUwXm7mMCOgXILPVHyPDa3NbMIFrk=;
 b=wJqaPZCoPikw55KmlGI2spRmypvnC1b89cfASOlHbBx+X2PFdA4g513lYIgevN1s/4
 7l9kxQQXpnFJPc4KCa7WoojCWmsG70oPg2IB5+XB9iWD4xyzDcm1xA0gdSQQbgWt66jU
 eXdiHfXudc9KkvbPf7zm9PTWiq+cN8R9VIYBtNJl+0Ic7KB1EXrlcRGJ4WEGdid8davt
 yzPLoRp+U3I0Hmw1y+Oc9VarXTQWH9RHz1dKX8tTPOgvzswbS03LkgjEGrGnuNecOLa7
 feRoACpqCzW0wuavFGVLdnblzul5BZj8oSlbTDR8kmdJ1a6YHSsFgAmPR/CYsgAlX+jS
 WKLw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=X+SzF5UbGZF5HyGUwXm7mMCOgXILPVHyPDa3NbMIFrk=;
 b=ZdtToAJh95WV7oegaDBZxT3Tdx4ZnJUN6WHOScv2k+BXaeHULZpzUcPsbl95bha2/a
 +CU50zfWF+lBrUZQQRdA/TSqBg0BUSmp680CKskNUDSpssPRIhrfSXibhBUIHusGqUse
 jl6Y+WHgg/og3hCzzIPA71jZwhiuahLwryfKHkQUqrHgqoibKsNWz6NF3eWEYvvydcmR
 6ycenj/appuFc6YG8lz5OuO21V35CiJ6GRKZKs0DRCKO64RF5UHfZkwXh7E6XEKeWz3H
 TrKMFwGTGEOjgkISZLStIkN+umnaIQ+CAZwlLO7lq0wMT/y7nLfhfgghtaL8GF1vYuzG
 Sgzg==
X-Gm-Message-State: ABuFfohHAOKG3XR6Gvi8Q7AAYmiEYMMOFh8p4vlTqXP0e/8W2dL/6m7T
 4Yye+4COo3jCk6dBsd02q9348o3saRyf8/tjl19Npg==
X-Google-Smtp-Source: ACcGV61kQ9L97XTJRCDDWnQg8lknx0evF3mAY1RW/J3NRIQbwfi37KNKX9EzE+R4KVQFGQxrUzkb5LPyP4m5DXcLAZ0=
X-Received: by 2002:adf:e5c7:: with SMTP id
 a7-v6mr8732274wrn.190.1538050197432; 
 Thu, 27 Sep 2018 05:09:57 -0700 (PDT)
MIME-Version: 1.0
References: <d61a791aaa734245ac705bb5196ff18e@HIDDEN>
 <87zhw3d4na.fsf@HIDDEN>
In-Reply-To: <87zhw3d4na.fsf@HIDDEN>
From: John Cowan <cowan@HIDDEN>
Date: Thu, 27 Sep 2018 08:09:46 -0400
Message-ID: <CAD2gp_RxPVhDxLt_Np_XMP=r2QxY5zVbW-+W65znqqA1f-+Y8A@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000aa43b80576d937d2"
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000aa43b80576d937d2
Content-Type: text/plain; charset="UTF-8"

On Wed, Sep 26, 2018 at 11:03 PM Mark H Weaver <mhw@HIDDEN> wrote:


> To initialize an alist that will be mutated, you must instead do
> something like this:
>
>   (define capitals (list (cons "New York" "Albany")
>                          (cons "Oregon"   "Salem")
>                          (cons "Florida"  "Miami")))
>

More simply, you can wrap the literal in a call to copy-tree.  This returns
a deep copy of the literal that is fully mutable.

-- 
John Cowan          http://vrici.lojban.org/~cowan        cowan@HIDDEN
Here lies the Christian, judge, and poet Peter,
Who broke the laws of God and man and metre.

--000000000000aa43b80576d937d2
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br><br><div class=3D"gmail_quote"><div d=
ir=3D"ltr">On Wed, Sep 26, 2018 at 11:03 PM Mark H Weaver &lt;<a href=3D"ma=
ilto:mhw@HIDDEN">mhw@HIDDEN</a>&gt; wrote:<br></div><div>=C2=A0</di=
v><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;borde=
r-left:1px solid rgb(204,204,204);padding-left:1ex">
To initialize an alist that will be mutated, you must instead do<br>
something like this:<br>
<br>
=C2=A0 (define capitals (list (cons &quot;New York&quot; &quot;Albany&quot;=
)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0(cons &quot;Oregon&quot;=C2=A0 =C2=A0&quot;Salem&quot;)<br=
>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0(cons &quot;Florida&quot;=C2=A0 &quot;Miami&quot;)))<br></=
blockquote><div><br></div><div>More simply, you can wrap the literal in a c=
all to copy-tree.=C2=A0 This returns</div><div>a deep copy of the literal t=
hat is fully mutable.</div><div><br></div><div>--=C2=A0</div><div><div>John=
 Cowan=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <a href=3D"http://vrici.lojban.org=
/~cowan">http://vrici.lojban.org/~cowan</a>=C2=A0 =C2=A0 =C2=A0 =C2=A0 <a h=
ref=3D"mailto:cowan@HIDDEN">cowan@HIDDEN</a></div><div>Here lies the Ch=
ristian, judge, and poet Peter,</div><div>Who broke the laws of God and man=
 and metre.</div></div><div><br></div></div></div></div>

--000000000000aa43b80576d937d2--





Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.