From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Zelphir Kaltstahl Newsgroups: gmane.lisp.guile.user Subject: Re: Macro for replacing a placeholder in an expression Date: Sat, 6 Aug 2022 14:28:47 +0000 Message-ID: References: <80083c86-19b0-7537-be70-f763bd5b390f@posteo.de> <1ede5481-9d46-84e9-2530-d64ac835568b@telenet.be> <5f0efafc-3045-e710-6066-9519692ebb44@posteo.de> <51f4c121-6143-345e-43d4-6f97e0be8501@telenet.be> <18fd1f47-0fac-420b-bb4f-37eddaa5315f@www.fastmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23605"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Guile User , Maxime Devos To: =?UTF-8?Q?Linus_Bj=c3=b6rnstam?= Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sat Aug 06 16:29:09 2022 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 1oKKnc-0005wV-K1 for guile-user@m.gmane-mx.org; Sat, 06 Aug 2022 16:29:08 +0200 Original-Received: from localhost ([::1]:39564 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oKKnb-0002sQ-9V for guile-user@m.gmane-mx.org; Sat, 06 Aug 2022 10:29:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oKKnP-0002sH-7H for guile-user@gnu.org; Sat, 06 Aug 2022 10:28:55 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:56751) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oKKnN-0000Wt-Cu for guile-user@gnu.org; Sat, 06 Aug 2022 10:28:54 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id DB728240028 for ; Sat, 6 Aug 2022 16:28:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1659796129; bh=ozPhChqSdJkHXNtl3IIDEYrUTK80cpECdcRlN7Pxvv4=; h=Date:Subject:To:Cc:From:From; b=AyZs3gJmsRu56muPstSWecEbeYrchJx6iJPmc0Jk52UwR7oE6Il44dWB94n1+esgr kmK8aa6AgiqUJpzsjkiGmQALEzbKNIsn2uDCNJ9AN9enSERZGJ3VTo2aDMvwIHqi0G +bNz/ktdocOgNvva8MiSU0n5eEkO/4bZIgTr06SxgZWm1dy70sZyalaVtOn9kr/stf nmbLj7abvpWqLbA5vf23mUEEAKqwSAko/eH80w7LaEQIiMBWHjVYPV9qLYf1dQSedF Dw4bZkdpLclZ9W4MvLpkEd2CtJ6aoRUN2OwegfTx1kSeOa0U3HmRBdo4LtWZRQsygH MnlAEcqh7kUiA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4M0PwJ4m9kz9rxB; Sat, 6 Aug 2022 16:28:48 +0200 (CEST) Content-Language: en-US In-Reply-To: <18fd1f47-0fac-420b-bb4f-37eddaa5315f@www.fastmail.com> Received-SPF: pass client-ip=185.67.36.65; envelope-from=zelphirkaltstahl@posteo.de; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 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:18491 Archived-At: Hello Linus! On 8/5/22 11:42, Linus Björnstam wrote: > I wrote this, which does a tree fold over a sexp: > > https://hg.sr.ht/~bjoli/megacut/browse/readme.txt?rev=tip > > It is unhygienic currently, and I will probably never change because I only use it at the repl. > > The code is really just a syntax-case version of the fast and efficient flatten algorithm, but without flattening. I might study it later. Thank you for that. I have found a solution to my previous problems of expansion order using CK macros described at: https://okmij.org/ftp/Scheme/macros.html#ck-macros. Everything seems to work now, except some cases with vectors, I think only with vector syntax #(...). That is what I am still trying to figure out. However, the current code is in my repository of Guile examples. I would (perma-)link to it, but currently notabug has an issue. Using CK macros does make the macros simpler, although one must get the quoting right, which is sometimes confusing. Best regards, Zelphir -- repositories: https://notabug.org/ZelphirKaltstahl