From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jens Egon Nyborg Newsgroups: gmane.lisp.guile.bugs Subject: bug#75364: Manual: Alist example does not work Date: Sat, 4 Jan 2025 16:59:15 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------2CDL9AlrzsKUBJdy0vS0DZhv" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11807"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: 75364@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Sat Jan 04 18:47:33 2025 Return-path: Envelope-to: guile-bugs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tU8FI-0002tM-DZ for guile-bugs@m.gmane-mx.org; Sat, 04 Jan 2025 18:47:32 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tU8F0-0007ry-1T; Sat, 04 Jan 2025 12:47:14 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tU8Es-0007qP-26 for bug-guile@gnu.org; Sat, 04 Jan 2025 12:47:09 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tU8Er-0000FQ-Ov for bug-guile@gnu.org; Sat, 04 Jan 2025 12:47:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=From:MIME-Version:Date:To:Subject; bh=LR4ek0/F3dcNc91xUoD2xPycVXuVZop8WOt08XdRM1w=; b=iHr+pXONTnpcy0Mnqac/93yKfW69scgMjzxT34vwo1bid2/NAA81NzlMxJvS5GR2MubtcZQuPIjk0myjEyXXGvsRf9GiNYOszJS7FDcEw1jsOzN5UiX0cYB3ltApeo4oShdF8kjZx0zooTwjCad2pz9q5lawfYijROGTYu2h5+GMO0mC2T4TF61chUZT90kSJdNlBk2NTII8BAnwz9oYR/RCd5rZUVkgtUxiAoldaat+5uMmifTHckqkqbRT+y2ji4+TBasH2mbgQ18iHcH6Ms0r7Nv4KYm/b39xU/By89WyXMj79fFsp22eeOMre6OCz4LBO01VKgg9MGALzlFzQA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tU8Er-0004Gx-GT for bug-guile@gnu.org; Sat, 04 Jan 2025 12:47:05 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jens Egon Nyborg Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sat, 04 Jan 2025 17:47:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 75364 X-GNU-PR-Package: guile X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.173601280916353 (code B ref -1); Sat, 04 Jan 2025 17:47:05 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Jan 2025 17:46:49 +0000 Original-Received: from localhost ([127.0.0.1]:57149 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tU8Ea-0004Fh-Pq for submit@debbugs.gnu.org; Sat, 04 Jan 2025 12:46:49 -0500 Original-Received: from lists.gnu.org ([2001:470:142::17]:37822) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tU6Yl-0007av-4s for submit@debbugs.gnu.org; Sat, 04 Jan 2025 10:59:32 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tU6Yf-0001CJ-0F for bug-guile@gnu.org; Sat, 04 Jan 2025 10:59:25 -0500 Original-Received: from mailrelay2-2.pub.mailoutpod2-cph3.one.com ([2a02:2350:5:407::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tU6Yc-0000w2-TD for bug-guile@gnu.org; Sat, 04 Jan 2025 10:59:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1736006355; x=1736611155; d=puggaard-nyborg.dk; s=rsa2; h=subject:from:to:mime-version:date:message-id:content-type:from; bh=LR4ek0/F3dcNc91xUoD2xPycVXuVZop8WOt08XdRM1w=; b=kTUkCJzgxdkxN4/5lQJboUOZlxGaf+YAoR4cBc7U4iTD5ty0seby1XsSEv6ziM7+8DJhjrCbme6v4 55Ryb6e1xi/kvHpKFqXQ9B53wsBHRGVuZPIkvXRslh1K/G4tYinHkdkiRUprFmC2AZ0gGp02zFccCs Rh05ZHv2Gqo0x1kCnXZ+DXrgbK0d9zfmAckMdKMmP2q/yt1NOnvkUHrwF7D/gpWC8EZ66S3cAL8BoW XiOQ6p2hOLBcbCS+UnKpSgKv7gDtAwcHAyQvhOCOxkwKHfR/s1V0leAfcbQs3qaoRlrEa0UxRnNE4S bzruA3+Z32bk/WkI5vNFI04oIYqASuQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1736006355; x=1736611155; d=puggaard-nyborg.dk; s=ed2; h=subject:from:to:mime-version:date:message-id:content-type:from; bh=LR4ek0/F3dcNc91xUoD2xPycVXuVZop8WOt08XdRM1w=; b=xOJBUzCq0tE5eRhk/AGbdzVK7jtz2Kp7SXB6cJ+wxc0XPE+0abYGHP0eey/obSEm03VOF5JmXDh4E lOasf+lCw== X-HalOne-ID: d8bafaee-cab4-11ef-b495-09b8706f39fe Original-Received: from [10.0.0.148] (085081063084.dynamic.telenor.dk [85.81.63.84]) by mailrelay2.pub.mailoutpod2-cph3.one.com (Halon) with ESMTPSA id d8bafaee-cab4-11ef-b495-09b8706f39fe; Sat, 04 Jan 2025 15:59:15 +0000 (UTC) Content-Language: en-US Received-SPF: none client-ip=2a02:2350:5:407::1; envelope-from=jens@puggaard-nyborg.dk; helo=mailrelay2-2.pub.mailoutpod2-cph3.one.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 04 Jan 2025 12:46:47 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.bugs:11150 Archived-At: This is a multi-part message in MIME format. --------------2CDL9AlrzsKUBJdy0vS0DZhv Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit I run (define capitals '(("New York" . "Albany") ("Oregon" . "Salem") ("Florida" . "Miami"))) followed by (set! capitals (assoc-set! capitals "Florida" "Tallahassee")) and get "ice-9/boot-9.scm:1676:22: In procedure raise-exception: In procedure set-cdr!: Wrong type argument in position 1 (expecting mutable pair): ("Florida" . "Miami") Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue." (In geiser in emacs on Arch) Warning: In my own code it actually worked on and off. Work-around: Use (define capitals (list (cons "New York" "Albany") (cons "Oregon" . "Salem") (cons "Florida" . "Miami"))) apparently quoted lists are not mutable! --------------2CDL9AlrzsKUBJdy0vS0DZhv Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

I run 

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

followed by

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

and get

"ice-9/boot-9.scm:1676:22: In procedure raise-exception:
In procedure set-cdr!: Wrong type argument in position 1 (expecting mutable pair): ("Florida" . "Miami")

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue."


(In geiser in emacs on Arch)

Warning: In my own code it actually worked on and off.

Work-around: Use

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

apparently quoted lists are not mutable!

--------------2CDL9AlrzsKUBJdy0vS0DZhv--