From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: mbcladwell@stihie.net Newsgroups: gmane.lisp.guile.user Subject: list-set! Wrong type argument in position 1 (expecting mutable pair) Date: Wed, 26 Aug 2020 15:12:32 -0500 Message-ID: <20200826151232.Horde.54lAstMht7PXoKcNHhj8vJT@www.stihie.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28724"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Horde Application Framework 5 To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Wed Aug 26 22:13:00 2020 Return-path: Envelope-to: guile-user@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 1kB1n1-0007LP-G6 for guile-user@m.gmane-mx.org; Wed, 26 Aug 2020 22:12:59 +0200 Original-Received: from localhost ([::1]:59942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kB1n0-0004mU-IV for guile-user@m.gmane-mx.org; Wed, 26 Aug 2020 16:12:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kB1mr-0004mN-5U for guile-user@gnu.org; Wed, 26 Aug 2020 16:12:49 -0400 Original-Received: from gateway20.websitewelcome.com ([192.185.64.36]:12019) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kB1mo-0003u5-Pk for guile-user@gnu.org; Wed, 26 Aug 2020 16:12:48 -0400 Original-Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 64E5C400C4D3F for ; Wed, 26 Aug 2020 13:48:51 -0500 (CDT) Original-Received: from gator3135.hostgator.com ([50.87.144.171]) by cmsmtp with SMTP id B1mbkI7wxCjCVB1mbk3crq; Wed, 26 Aug 2020 15:12:33 -0500 X-Authority-Reason: nr=8 Original-Received: from [50.87.144.171] (port=12402 helo=gator3135.hostgator.com) by gator3135.hostgator.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1kB1mb-003eKB-43 for guile-user@gnu.org; Wed, 26 Aug 2020 15:12:33 -0500 Original-Received: from [100.0.196.207] ([100.0.196.207]) by www.stihie.net (Horde Framework) with HTTPS; Wed, 26 Aug 2020 15:12:32 -0500 Content-Disposition: inline X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3135.hostgator.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stihie.net X-BWhitelist: no X-Source-IP: 50.87.144.171 X-Source-L: Yes X-Exim-ID: 1kB1mb-003eKB-43 X-Source-Sender: (gator3135.hostgator.com) [50.87.144.171]:12402 X-Source-Auth: mbcladwell@stihie.net X-Email-Count: 1 X-Source-Cap: cGxhcGFuO3BsYXBhbjtnYXRvcjMxMzUuaG9zdGdhdG9yLmNvbQ== X-Local-Domain: yes Received-SPF: pass client-ip=192.185.64.36; envelope-from=mbcladwell@stihie.net; helo=gateway20.websitewelcome.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/26 16:12:33 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:16838 Archived-At: Hi, One shortcoming I find working with Guile is the limited number of examples of how to use code. Consider list-set!. The only reference in the entire Guile manual is the definition in section 6.6.9.6 List Modification. If I google I find https://docs.racket-lang.org/reference/pairs.html which gives me the example (list-set '(zero one two) 2 "two") ==> '(zero one "two") which is what I deduced from the Guile manual. If I try something similar in Guile: scheme@(guile-user)> (list-set! '("zero" "one" "twooooo") 2 "two") ice-9/boot-9.scm:1669:16: In procedure raise-exception: In procedure set-car!: Wrong type argument in position 1 (expecting mutable pair): ("twooooo") Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. scheme@(guile-user) [1]> ,bt 1 (list-set! ("zero" "one" "twooooo") 2 "two") In ice-9/boot-9.scm: 1669:16 0 (raise-exception _ #:continuable? _) Could someone provide me with an example of how to use list-set! ? Alternatively what I really need is how to modify a specified element in a list. Thanks Mortimer