divert wont work at arguments - they are ignored. Now I don't use divert anymore. A good replacement is autoconf's sugar.m4's m4_expand or alike which can do much better.
On Fri, Jun 21, 2024 at 12:02 PM <m4-discuss-requ...@gnu.org> wrote: > Send m4-discuss mailing list submissions to > m4-discuss@gnu.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.gnu.org/mailman/listinfo/m4-discuss > or, via email, send a message with subject or body 'help' to > m4-discuss-requ...@gnu.org > > You can reach the person managing the list at > m4-discuss-ow...@gnu.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of m4-discuss digest..." > > > Today's Topics: > > 1. diversion while collecting arguments (René Nyffenegger) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Thu, 20 Jun 2024 18:00:02 +0200 > From: René Nyffenegger <m...@renenyffenegger.ch> > To: m4-discuss@gnu.org > Subject: diversion while collecting arguments > Message-ID: <a1db89dd-35db-4597-b39c-1dccc3837...@renenyffenegger.ch> > Content-Type: text/plain; charset=UTF-8; format=flowed > > I have a file with the following content: > > define(show_arguments, `arg-1 = $1 > arg-2 = $2 > ') > > divert(1)A`'divert(0)a > > show_arguments( > divert(1)X`'divert(0)1st, > divert(1)Y`'divert(0)2nd) > > divert(1)B`'divert(0)b > > - - - - - > > m4 processes this file to: > > a > > arg-1 = X1st > arg-2 = Y2nd > > > b > AB > > - - - - - - > > I expected the > divert(1)X`'divert(0) > and > divert(1)Y`'divert(0)2nd) > > to divert the X and Y so that it is emitted at the end. > > Can someone explain why this is not the case? > > Thanks > > Rene > > > > > End of m4-discuss Digest, Vol 137, Issue 1 > ****************************************** >