[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Changes to m4/doc/m4.texinfo,v [branch]
From: |
Eric Blake |
Subject: |
Changes to m4/doc/m4.texinfo,v [branch] |
Date: |
Tue, 06 Jun 2006 12:39:55 +0000 |
CVSROOT: /sources/m4
Module name: m4
Branch: branch
Changes by: Eric Blake <ericb> 06/06/06 12:39:53
Index: doc/m4.texinfo
===================================================================
RCS file: /sources/m4/m4/doc/m4.texinfo,v
retrieving revision 1.1.1.1.2.16
retrieving revision 1.1.1.1.2.17
diff -u -b -r1.1.1.1.2.16 -r1.1.1.1.2.17
--- doc/m4.texinfo 6 Jun 2006 12:28:46 -0000 1.1.1.1.2.16
+++ doc/m4.texinfo 6 Jun 2006 12:39:53 -0000 1.1.1.1.2.17
@@ -840,6 +840,19 @@
whitespace, remember that leading unquoted whitespace is never part
of an argument, but trailing whitespace always is.
+It is possible for a macro's definition to change during argument
+collection, in which case the expansion uses the definition that was in
+effect at the time the opening @samp{(} was seen.
+
address@hidden
+define(`f', `1')
address@hidden
+f(define(`f', `2'))
address@hidden
+f
address@hidden
address@hidden example
+
@node Quoting Arguments, Macro expansion, Macro Arguments, Macros
@section Quoting macro arguments
@@ -1121,6 +1134,18 @@
@result{}foo
@end example
+Undefining a macro inside that macro's expansion is safe; the macro
+still expands to the definition that was in effect at the @samp{(}.
+
address@hidden
+define(`f', `.$1')
address@hidden
+f(f(f(undefine(`f')`hello world')))
address@hidden world
+f(`bye')
address@hidden(bye)
address@hidden example
+
It is not an error for @var{name} to have no macro definition. In that
case, @code{undefine} does nothing.
@@ -1569,6 +1594,21 @@
The last example shows how builtin macros definitions are displayed.
+The definition that is dumped corresponds to what would occur if the
+macro were to be called at that point, even if other definitions are
+still live due to redefining a macro during argument collection.
+
address@hidden
+pushdef(`f',`1')pushdef(`f',`2')
address@hidden
+f(popdef(`f')dumpdef(`f'))
address@hidden: `1'
address@hidden
+f(popdef(`f')dumpdef(`f'))
address@hidden:7: m4: Undefined name f
address@hidden
address@hidden example
+
@xref{Debug Levels}, for information on controlling the details of the
display.