CVSROOT:        /sources/m4
Module name:    m4
Changes by:     Eric Blake <ericb>      07/02/28 14:36:22

Index: doc/m4.texinfo
===================================================================
RCS file: /sources/m4/m4/doc/m4.texinfo,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -b -r1.96 -r1.97
--- doc/m4.texinfo      5 Feb 2007 17:31:10 -0000       1.96
+++ doc/m4.texinfo      28 Feb 2007 14:36:22 -0000      1.97
@@ -2265,7 +2265,12 @@
 If a macro with several definitions is redefined with @code{define}, the
 topmost definition is @emph{replaced} with the new definition.  If it is
 removed with @code{undefine}, @emph{all} the definitions are removed,
-and not only the topmost one.
+and not only the topmost one.  However, @acronym{POSIX} allows other
+implementations that treat @code{define} as replacing an entire stack
+of definitions with a single new definition, so to be portable to other
+implementations, it may be worth explicitly using @code{popdef} and
[EMAIL PROTECTED] rather than relying on the @acronym{GNU} behavior of
[EMAIL PROTECTED]
 
 @example
 define(`foo', `Expansion one.')
@@ -7311,13 +7316,11 @@
 in traditional programming languages.
 
 @item
-Some implementations of @code{m4} (Solaris for example) conform to
[EMAIL PROTECTED], which requires @code{define(@var{macro})} to behave
-like @code{undefine(@var{macro})pushdef(@var{macro})}.  Other
-implementations, including GNU @code{m4} without the @samp{-G} option
-and without @env{POSIXLY_CORRECT} set, treat
[EMAIL PROTECTED](@var{macro})} as
[EMAIL PROTECTED](@var{macro})pushdef(@var{macro})}.
+Traditional implementations handle @code{define(`f',`1')} (@pxref{Define})
+by undefining the entire stack of previous definitions, and if doing
[EMAIL PROTECTED](`f')} first.  @acronym{GNU} @code{m4} replaces just the top
+definition on the stack, as if doing @code{popdef(`f')} followed by
[EMAIL PROTECTED](`f',`1')}.  @acronym{POSIX} allows either behavior.
 
 @item
 @acronym{POSIX} states that only unquoted leading newlines and blanks


Reply via email to