Re: [PATCH] use m4_require to implement AS_REQUIRE

Paolo Bonzini <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.patches,gmane.comp.gnu.m4.general
Message-ID <[email protected]>
> The point is that text goes into a diversion only when _you are not doing
> argument collection_ - in other words, the macro call must be expanded at
> the outermost level.  Any macro that potentially changes the current
> diversion must be quoted, rather than expanded in advance, when handed as
> an argument to another macro; otherwise, the text output while the
> diversion change is in effect doesn't go to the changed diversion, but to
> the argument collection.

Yeah, that's the similar testcase I got:

m4_init
m4_define([FROBIT],
          [m4_divert_text([6], [in diversion _m4_divert_diversion])$1])
m4_define([SHOWIT], [$[]1 is $1])
m4_define([TEXT], [FROBIT(text)])
m4_divert_pop([KILL])
m4_divert_push([1000])dnl
SHOWIT([TEXT])

and that's also the reason why the original testcase was failing.

Paolo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.