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. 

-- 
  Linus Björnstam

On Sat, 30 Jul 2022, at 23:13, Maxime Devos wrote:
> On 30-07-2022 17:42, Zelphir Kaltstahl wrote:
>>
>> Does this mean, that recursive application of a macro inside a macro 
>> is impossible? To expand to subforms being the same macro again and 
>> this way transform a whole tree of s-expressions?
>>
> You can have recursive macros, see e.g. the let^ macro at 
> <https://git.gnunet.org/gnunet-scheme.git/tree/gnu/gnunet/utils/hat-let.scm>.
>
> However, I do not see a way to implement recursivity the same way for 
> your macro.
>
> Greetings,
> Maxime.
>
>
> Attachments:
> * OpenPGP_0x49E3EE22191725EE.asc
> * OpenPGP_signature

Reply via email to