2008-12-18 Eric Blake <ebb9@byu.net>
+ Mention limitation of M4 1.4.x on builtin tokens.
+ * doc/autoconf.texi (Redefined M4 Macros) <m4_dumpdef>: Document
+ ramification of M4 1.4.x's inability to pass builtin tokens
+ through text macros.
+ (Evaluation Macros) <m4_curry>: Likewise.
+ * tests/m4sugar.at (m4@&t@_defn): Enhance test.
+ * NEWS: Mention subtle change in m4_dumpdef semantics.
+
Document m4_version_prereq.
* doc/autoconf.texi (Number processing Macros)
<m4_version_prereq>: Add documentation.
m4_chomp m4_curry m4_default_quoted m4_esyscmd_s m4_map_args
m4_map_args_pair m4_set_map
-** The following m4sugar macros are documented now:
+** The following m4sugar macros are documented now, but in some cases
+ with slightly different semantics than what the previous
+ undocumented version had:
m4_copy m4_dumpdefs m4_rename m4_version_prereq
** The m4sugar macro m4_expand has been taught to handle unterminated
calls @code{m4_dumpdef} for all of the
@code{m4_pushdef} stack of definitions, starting with the current, and
silently does nothing if @var{name} is undefined.
+
+Unfortunately, due to a limitation in M4 1.4.x, any macro defined as a
+builtin is output as the empty string. This behavior is rectified by
+using M4 1.6 or newer. However, this behavior difference means that
+@code{m4_dumpdef} should only be used while developing m4sugar macros,
+and never in the final published form of a macro.
@end defmac
@defmac m4_esyscmd_s (@var{command})
m4_curry([m4_curry], [m4_reverse], [1])([2])([3])
@result{}3, 2, 1
@end example
+
+Unfortunately, due to a limitation in M4 1.4.x, it is not possible to
+pass the definition of a builtin macro as the argument to the output of
+@code{m4_curry}; the empty string is used instead of the builtin token.
+This behavior is rectified by using M4 1.6 or newer.
@end defmac
@defmac m4_do (@var{arg}, @dots{})
# Check that pushdef stacks can be renamed.
AT_CHECK_M4SUGAR_TEXT([[m4_pushdef([a], [1])dnl
m4_pushdef([a], [2])dnl
+m4_pushdef([a], m4_defn([m4_divnum]))dnl
a b c
m4_rename([a], [b])dnl
a b c
a b c
m4_popdef([b], [c])dnl
a b c
-]], [[2 b c
-a 2 c
+m4_popdef([b], [c])dnl
+a b c
+]], [[0 b c
+a 0 c
+a 0 0
a 2 2
a 1 1
a b c