unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Zelphir Kaltstahl <zelphirkaltstahl@posteo.de>
To: "Linus Björnstam" <linus.internet@fastmail.se>
Cc: Guile User <guile-user@gnu.org>, Maxime Devos <maximedevos@telenet.be>
Subject: Re: Macro for replacing a placeholder in an expression
Date: Sat,  6 Aug 2022 14:28:47 +0000	[thread overview]
Message-ID: <d2b0515b-feb1-5223-2c05-8ae59b4929ee@posteo.de> (raw)
In-Reply-To: <18fd1f47-0fac-420b-bb4f-37eddaa5315f@www.fastmail.com>

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




  reply	other threads:[~2022-08-06 14:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-27 23:57 Macro for replacing a placeholder in an expression Zelphir Kaltstahl
2022-07-28  0:55 ` Maxime Devos
2022-07-28 10:23   ` Zelphir Kaltstahl
2022-07-28 10:28     ` Maxime Devos
2022-07-30 15:42     ` Zelphir Kaltstahl
2022-07-30 20:44       ` Maxime Devos
2022-07-30 21:10         ` Maxime Devos
2022-07-30 21:13       ` Maxime Devos
2022-08-05  9:42         ` Linus Björnstam
2022-08-06 14:28           ` Zelphir Kaltstahl [this message]
2022-07-28  1:04 ` Maxime Devos
2022-07-28  8:39   ` Zelphir Kaltstahl
2022-07-28  9:48     ` Maxime Devos
2022-07-28 11:26       ` Zelphir Kaltstahl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d2b0515b-feb1-5223-2c05-8ae59b4929ee@posteo.de \
    --to=zelphirkaltstahl@posteo.de \
    --cc=guile-user@gnu.org \
    --cc=linus.internet@fastmail.se \
    --cc=maximedevos@telenet.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).