Avoid extra side effects in m4sugar list expansion.
commit550a9fa1e1f12b297730bf6db132fc4818686a33
authorEric Blake <ebb9@byu.net>
Fri, 22 Aug 2008 04:17:33 +0000 (21 22:17 -0600)
committerEric Blake <ebb9@byu.net>
Fri, 22 Aug 2008 04:17:33 +0000 (21 22:17 -0600)
tree0b017b322143eeaba19c9bf44a9a43d1aa9f8540
parent6d5b7504056c01b791c7ca2518d2cecbecac96d7
Avoid extra side effects in m4sugar list expansion.

* lib/m4sugar/m4sugar.m4 (m4_mapall_sep, m4_list_cmp): Wrap
around...
(_m4_mapall_sep, _m4_list_cmp_raw): ...new helpers, to avoid
duplicate side effects.
(m4_version_compare): Adjust caller.
* lib/m4sugar/foreach.m4 (m4_list_cmp): Rename...
(_m4_list_cmp_raw): ...to match m4sugar.
* doc/autoconf.texi (Looping constructs): Document the behavior of
side effects.
* tests/m4sugar.at (M4 loops, m4@&t@_map, m4@&t@_version_compare):
Ensure only one side effect.
(recursion): Fix test typo.
Reported by Ralf Wildenhues.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
doc/autoconf.texi
lib/m4sugar/foreach.m4
lib/m4sugar/m4sugar.m4
tests/m4sugar.at